Pcl in ros tutorial [closed]

asked 2013-03-11 04:24:16 -0600

mdegges gravatar image

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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-11-19 19:52:43.729728



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

Stephane.M gravatar image Stephane.M  ( 2013-03-11 04:29:34 -0600 )edit

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?

mdegges gravatar image mdegges  ( 2013-03-11 07:04:12 -0600 )edit

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

mdegges gravatar image mdegges  ( 2013-03-11 07:15:45 -0600 )edit

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

Stephane.M gravatar image Stephane.M  ( 2013-03-11 21:13:11 -0600 )edit

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

mdegges gravatar image mdegges  ( 2013-03-12 10:06:22 -0600 )edit

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

Stephane.M gravatar image Stephane.M  ( 2013-03-13 01:04:52 -0600 )edit