Pcl in ros tutorial [closed]
My goal is to subscribe to pointclouds in my .bag file, grab their width, height, and density boolean, and use that data in another program. I followed http://www.ros.org/wiki/pcl/Tutorials (this) tutorial on ros.org so that I can use other tutorials on the pcl.org website.. but when I run the program as is, nothing happens.
I saw another question on ros answers whose program worked once he changed the input from 'input:=/narrow_stereo_textured/points2' to 'input:=/camera/depth_registered/points'. However, my input should be coming from a .bag file saved in my package. I tried to do 'input:=/sr/pointcloud2_raw' (to get the pointcloud data from my .bag file) but that didn't work.
I thought the purpose of using a publisher/subscriber was so that I didn't have to manually convert my .bag pointclouds to .pcd files saved on my machine. That is what I want to do- just grab and pass the pointcloud data into another program.
when you play your bag file, do a "rostopic list", to know what is the name of your pointcloud message. Then put input:=/your_poincloud_topic
the pointcloud topic is /sr/pointcloud2_raw, but like i said above, nothing happens when i run 'rosrun my_pcl_tutorial example input:=/sr/pointcloud2_raw'. any ideas why?
oh- i just tried using 'input:=/sensor_msgs/PointCloud2 (a message inside the pointcloud topic), but that doesn't work either.. not sure what the problem is
Are you sure messages are being published ? When you do your rosbag info, see if any messages have been recorded.
there are 2507 messages in my test.bag file, and 494 msgs under the /sr/pointcloud2_raw topic.
When you play your bag file, are you sure you are publishing with the option "--clock" ? And that you used the command "rosparam set /use_sim_time true" ?