How to use sensor_msgs/LaserScan's message about rangers[]

asked 2016-08-06 22:08:32 -0600

chenlee gravatar image

updated 2016-08-07 05:27:14 -0600

I want to use kinect's ranger date,I subscribe the sensor_msgs/LaserScan's message,my callback function is below ,for I want to see the rangers[] date:

void kinectMessageReceived(const sensor_msgs::LaserScan& msg)
{
    ROS_INFO_STREAM(msg.ranges[0]);
}

but I received the follow message ,so why it input nan ,what I can do to get ranger message?

[ INFO] [1470536730.887186730]: nan
[ INFO] [1470536730.921098262]: nan
[ INFO] [1470536730.952966983]: nan
[ INFO] [1470536730.986829834]: nan
[ INFO] [1470536731.023610700]: nan
[ INFO] [1470536731.055973256]: nan
[ INFO] [1470536731.086879971]: nan
[ INFO] [1470536731.121896758]: nan
edit retag flag offensive close merge delete

Comments

chenlee gravatar imagechenlee ( 2016-08-06 22:01:50 -0600 )edit
1

Maybe nan value is due to a value outside the min-max distance range.

To have a better understanding of laserscan message, there is the following topic with a very good answer

F.Brosseau gravatar imageF.Brosseau ( 2016-08-08 04:31:36 -0600 )edit

Thanks,the answer is what you said.

chenlee gravatar imagechenlee ( 2016-08-08 07:53:08 -0600 )edit