def laser_callback(msg):
front = msg.ranges[90]
right = msg.ranges[45]
left = msg.ranges[135]
back = msg.ranges[0]
print("Laser range ", msg.ranges[45])
min_value = min(msg.ranges) # find minimum value
min_index = msg.range.index(min_value) # get location
print("min_value, min_index ", min_value, min_index)
i am getting error on line 26:
File “/home/user/catkin_ws/src/sm_pkg/scripts/findwall_service.py”, line 26, in laser_callback
min_index = msg.range.index(min_value) # get location
AttributeError: ‘LaserScan’ object has no attribute ‘range’
thanks