ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to find the frame id of a bag file

asked 2011-11-17 09:03:30 -0600

karthik gravatar image

updated 2011-11-18 05:21:48 -0600

Hi, I recorded a bag file to fetch the /camera/rgb/points topic published by a kinect with

rosbag record /camera/rgb/points

I am able to play the file back and see the pointclouds in rviz When i try to convert this bag to pcd using

rosrun pcl_ros bag_to_pcd source.bag /camera/rgb/points .

I get the following error

Saving recorded sensor_msgs::PointCloud2 messages on topic /camera/rgb/points to .
[ERROR] [1321569889.237783893]: Frame id /base_link does not exist! Frames (1): 
Segmentation fault

I tried changing the /base_link in the bag_to_pcd.cpp to /openni_camera but its not working even then. I guess the frame id has to appropriate and I am missing something here. So help me figure out the frame id of the recorded pointcloud in my bag file.

Thanks, Karthik


After recording the bag file with /tf included and then doing the bag_to_pcd gives me the following error

[ERROR] [1321638863.658386805]: Frame id /base_link does not exist! Frames (6): Frame /openni_depth_frame exists with parent /openni_camera.
Frame /openni_camera exists with parent NO_PARENT.
Frame /openni_depth_optical_frame exists with parent /openni_depth_frame.
Frame /openni_rgb_optical_frame exists with parent /openni_rgb_frame.
Frame /openni_rgb_frame exists with parent /openni_camera.

Segmentation fault

So the Frame id is still a problem here?.

Thanks, Karthik


After running the static transform publisher while recording i get the following error while converting

[ERROR] [1321643793.300622410]: Unable to lookup transform, cache is empty, when looking up transform from frame [/openni_rgb_optical_frame] to frame [/base_link]
Segmentation fault

I am not sure what we are doing here. Can you give me the links where significance of this can be learnt?

Thanks Karthik

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-11-17 14:50:25 -0600

fergs gravatar image

updated 2011-11-18 04:29:23 -0600

A quick look at the source code for bag_to_pcd shows that it wants to use TF. The quick solution is to record tf in addition to the point cloud with:

rosbag record /camera/rgb/points /tf

It looks like the tf frame is hard coded to "base_link", however there should probably be an option to set the frame. You might consider ticketing this as a future improvement.

Update: Ok, so then you are lacking a base_link. You can create a base_link to openni transform by running the following (when you are collecting the bag file!):

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

Alternatively, you could edit the source to bag_to_pcd.cpp to use one of your existing links.

edit flag offensive delete link more

Comments

As a general rule, you should just always record /tf. Just about everything uses it in some way.
Mac gravatar image Mac  ( 2011-11-17 16:25:25 -0600 )edit
How do i ticket this as a future improvement
karthik gravatar image karthik  ( 2011-11-18 03:39:47 -0600 )edit
Fergs,I have updated my question with the latest error. Pls let me know the mistake
karthik gravatar image karthik  ( 2011-11-18 04:10:59 -0600 )edit
There should be an issue tracker on the pointclouds.org site (I would recommend using that one since pcl_ros appears to be in their SVN repo). You might send an email to pcl-users mailing list to get more help.
fergs gravatar image fergs  ( 2011-11-18 04:30:46 -0600 )edit
Thanks Fregs. I updated my question again.
karthik gravatar image karthik  ( 2011-11-18 05:22:25 -0600 )edit

Question Tools

Stats

Asked: 2011-11-17 09:03:30 -0600

Seen: 3,792 times

Last updated: Nov 18 '11