Robotics StackExchange | Archived questions

Pcl in ros tutorial

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 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:=/narrowstereotextured/points2' to 'input:=/camera/depthregistered/points'. However, my input should be coming from a .bag file saved in my package. I tried to do 'input:=/sr/pointcloud2raw' (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.

Asked by mdegges on 2013-03-11 04:24:16 UTC

Comments

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

Asked by Stephane.M on 2013-03-11 04:29:34 UTC

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?

Asked by mdegges on 2013-03-11 07:04:12 UTC

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

Asked by mdegges on 2013-03-11 07:15:45 UTC

Are you sure messages are being published ? When you do your rosbag info, see if any messages have been recorded.

Asked by Stephane.M on 2013-03-11 21:13:11 UTC

there are 2507 messages in my test.bag file, and 494 msgs under the /sr/pointcloud2_raw topic.

Asked by mdegges on 2013-03-12 10:06:22 UTC

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" ?

Asked by Stephane.M on 2013-03-13 01:04:52 UTC

Answers