Hi,<br>I'm trying to write a node that subscribes to the "/scan" topic, which is published by sicktoolbox_wrapper. I tried to modify some of the code given in the "Writing a Simple Publisher/Subscriber" tutorial: <br>
<br>#include <ros/ros.h><br>#include <std_msgs/String.h><br>#include <sensor_msgs/LaserScan.h><br><br>void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_msg)<br><br>{<br>  ROS_INFO("Received [%s]", scan_msg);<br>
}<br><br>int main(int argc, char** argv)<br>{<br>  ros::init(argc, argv, "listener");<br>  ros::NodeHandle n;<br>  ros::Subscriber scan_sub = n.subscribe("scan", 100, scanCallback);<br>  ros::spin();<br>
}<br><br>The part where I think I'm getting tripped up is line 8 (the ROS_INFO command) -- how do I handle the unique data type LaserScan that sicktoolbox_wrapper uses to publish the scan data? I want to print the range values out, preferably as one long string -- what is the best way to convert the LaserScan type data into a string (or array)? <br>
<br>Thanks a lot --<br>Rishi<br><br clear="all">Rishi Bedi<br><a href="mailto:rbedi100@gmail.com">rbedi100@gmail.com</a><br>