ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

According to sensor_msgs/Range.msg, the data is in msg->range. The range is a single number. If you were to use the sensor_msgs/LaserScan.msg instead the set of ranges would be found in msg->ranges. Then msg->range.size() would have some meaning (since it's a vector).

According to sensor_msgs/Range.msg, the data is in msg->range. The range is a float32 (a single number. number).

If you were to use the sensor_msgs/LaserScan.msg instead instead, the set of ranges would be found in msg->ranges. Then msg->range.size() would have some meaning (since it's a vector).