How to use sensor_msgs/LaserScan's message about rangers[]
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
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
Thanks,the answer is what you said.