old_contents: #!/usr/bin/env python
  
  import rospy
  from sensor_msgs.msg import LaserScan
  
  rospy.init_node('laser_scan_publisher')
  
  scan_pub = rospy.Publisher('/dummy/scan', LaserScan, queue_size=50)
  
  num_readings = 100
  laser_frequency = 40
  
  count = 1
  r = rospy.Rate(1.0)
  while not rospy.is_shutdown():
      current_time = rospy.Time.now()
  
      scan = LaserScan()
  
      scan.header.stamp = current_time
      scan.header.frame_id = 'laser_frame'
      scan.angle_min = -1.57
      scan.angle_max = 1.57
      scan.angle_increment = 3.14 / num_readings
      scan.time_increment = (1.0 / laser_frequency) / (num_readings)
      scan.range_min = 0.0
      scan.range_max = 100.0
  
      scan.ranges = []
      scan.intensities = []
      for i in range(0, num_readings):
          scan.ranges.append(1.0 * count)  # fake data
          scan.intensities.append(1)  # fake data
  
      scan_pub.publish(scan)
      #count += 1
      r.sleep()
new_contents: #!/usr/bin/env python
  
  import rospy
  from sensor_msgs.msg import LaserScan
  
  rospy.init_node('laser_scan_publisher')
  
  scan_pub = rospy.Publisher('/dummy/scan', LaserScan, queue_size=50)
  
  num_readings = 1
  laser_frequency = 40
  
  count = 1
  r = rospy.Rate(1.0)
  while not rospy.is_shutdown():
      current_time = rospy.Time.now()
  
      scan = LaserScan()
  
      scan.header.stamp = current_time
      scan.header.frame_id = 'laser_frame'
      scan.angle_min = -0.004#-1.57
      scan.angle_max = 0.004#1.57
      scan.angle_increment = 0.004#3.14 / num_readings
      scan.time_increment = 0.1#(1.0 / laser_frequency) / (num_readings)
      scan.range_min = 0.0
      scan.range_max = 100.0
  
      scan.ranges = []
      #scan.intensities = []
      for i in range(0, num_readings):
          scan.ranges.append(1.0 * count)  # fake data
          scan.ranges.append(1.0 * count)  # fake data
          scan.ranges.append(1.0 * count)  # fake data
          #scan.intensities.append(1)  # fake data
          #scan.intensities.append(1)  # fake data
          #scan.intensities.append(1)  # fake data
  
      scan_pub.publish(scan)
      #count += 1
      r.sleep()
subject: fix laserscan test