Robotics StackExchange | Archived questions

What does the "range" attribute of the Range object from the sensor_msgs.msg package actually mean?

What does the "range" attribute of the Range object from the sensor_msgs.msg package actually mean? What does its value represent?

After having read the documentation, I have still not understood what its value represents. I am getting values (from 7 sensors of a robot, 5 in the front and 2 in the back) which I can't really make sense of.

Asked by nbro on 2018-05-03 14:45:44 UTC

Comments

Answers

range is the distance the sensor measures in metres. I hate to state the obvious, but that is what the docs for the field also state: range data [m].

Distance from what?

From the sensor's 'origin', wherever/however that is defined by the manufacturer.

If the driver for your sensor has been written properly, it should set that in the header.frame_id field. This is the same for any other sensor msg that has a Header.

From the sensor's origin to what?

You are serious, right?

Distance to whatever distant point the range sensor is measuring the distance to. So for a sonar that would mean half the distance between the sonar emitter, the reflecting surface and the sonar detector. Refer to wikibooks/Robotics/Sensors/Ranging Sensors for some examples or ranging sensors.

Yes, I am serious. I am getting weird values. All the range values of the sensors, if they are not detecting anything, should all be equal, but not in my case.

Well I can't help you with that. I also don't believe they should all necessarily be equal. There is always noise, and especially with multiple sensors the possibility that they are detecting each other (at least with sonars), reflections, etc, etc.

Asked by gvdhoorn on 2018-05-03 15:00:49 UTC

Comments

@gvdhoorn Distance from what?

Asked by nbro on 2018-05-03 15:01:53 UTC

@gvdhoorn From the sensor's origin to what?

Asked by nbro on 2018-05-03 15:07:30 UTC

@gvdhoorn Yes, I am serious. I am getting weird values. All the range values of the sensors, if they are not detecting anything, should all be equal, but not in my case.

Asked by nbro on 2018-05-03 15:18:43 UTC