Ask Your Question

bag_to_pcd Frame Id

asked 2012-05-01 12:53:22 -0500

dtj gravatar image


I'm processing a kinect point cloud with Electric + Ubuntu 11.10. I've recorded a .bag file with the topics /tf & /camera/depth/points. Using "rosbag play", rviz shows a beautiful point cloud.

I'm trying to convert the individual point clouds to pcd format so I can process them with PCL. Initially, I got this error. So, I followed the response to that question and ran:

rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link openni_camera 100

While I re-recorded the data in hopes of making bag_to_pcd happy. Sadly, when I run

rosrun pcl_ros bag_to_pcd data6_2012_05_01.bag /camera/depth/points d6_expand/

I now get:

"Saving recorded sensor_msgs::PointCloud2 messages on topic /camera/depth/points to d6_expand/

Frame /base_link exists with parent NO_PARENT.

Segmentation fault"

How can I make bag_to_pcd happy? Should I attempt to change the bag_to_pcd code? Specifically,

pcl_ros::transformPointCloud ("/base_link", *cloud, cloud_t, tf_listener);

& if I should change it what should it be? Would

pcl_ros::transformPointCloud ("/tf", *cloud, cloud_t, tf_listener);

work? I'm a new to ROS so I don't fully understand what is going on yet. This seems to be a reoccurring issue on both the ROS questions and PCL users lists so I'd love to get fixed.

Thanks for you help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-05-01 22:55:16 -0500

Lorenz gravatar image

I actually think that bag_to_pcd is broken and I'm not sure if it is actually still maintained. See this ticket. The fact that it requires a TF tree at all makes it really hard to use in many environments. What I did to be able to transform any point cloud is to change it to not do any TF transforms at all, i.e. I got rid of the call to transformPointCloud replaced all occurrences of cloud_t by cloud in the rest of the code. Note that this might break some use cases that actually require transformation of the point cloud to a common frame.

Replacing the target frame "base_link" with "tf" will probably not work. Rather, you could change it to openni_camera.

edit flag offensive delete link more


I didn't actually do this (what was below worked), but it's a great idea, would totally work, & this should be incorporated into ros. Is there a way I can +1 this somewhere?

dtj gravatar image dtj  ( 2012-05-02 22:55:59 -0500 )edit

answered 2012-05-02 03:40:14 -0500

Moataz Elmasry gravatar image

just out of curiosity, what happens, if you run "rosbag play" in one console, and in the other console "rosrun pcl_ros pointcloud_to_pcd input:=/camera/depth/points"

edit flag offensive delete link more


This works, thank you!

dtj gravatar image dtj  ( 2012-05-02 22:54:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-05-01 12:53:22 -0500

Seen: 1,877 times

Last updated: May 02 '12