tf works only in one way

asked 2018-10-09 02:17:34 -0600

ManMan88 gravatar image

updated 2018-10-10 02:53:48 -0600

Using ROS kinetic on Ubuntu 16.04.

I have a urdf description of an industrial robot which works just fine, which has a fixed frame called base_link (which is linked to world). I also use a realsense camera which has its own tf tree. The base link of this tree is camera_link.

I want to display in rviz the rgbd point-cloud from the realsense together with the robot, and of course this point-cloud should be in the correct location in respect to the robot.

Currently, the camera is static (not located on the robot), so I created a node that all it does is publish a simple constant transformation between base_link (parent) and camera_link (child). When I check rqt_tf_tree, everything looks just fine.

However, when displaying both robot model and PointCloud2 together in rviz (when world is set as the fixed frame), I get an error in PointCloud2 saying that there's no transformation between base_link and camera_link. The really weird thing though, is that when I set camera_link as the fixed frame, there's no error and rviz display correctly everything. The only problem is that I don't want rviz to use camera_link as the fixed frame, because then everything is "shifted" in the view.

Does anyone as an idea why would this happen and how can I fix it?

Thanks a lot!


here is an image of rqt_tf_tree image description

edit retag flag offensive close merge delete


Can you show us the output of rqt_tf_tree. Also did you make your own node from scratch or use the tf static_transform_publisher to create the base_link to camera_link tf?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-10-09 02:47:20 -0600 )edit

I added the rqt_tf_tree image. I did not use tf static_transform_publisher, I will try it, thanks.

ManMan88 gravatar image ManMan88  ( 2018-10-10 02:54:19 -0600 )edit

I just tried using tf static_transform_publisher. Now I get this error when base_link is the fixed frame Message removed because it is too old (frame=[camera_color_optical_frame], stamp=[1048542188.000032516]).

When camera_link is the fixed frame I get no error

ManMan88 gravatar image ManMan88  ( 2018-10-10 10:38:27 -0600 )edit

I increased the publish rate to 1000Hz and this error is gone, but now I get the original error again.

ManMan88 gravatar image ManMan88  ( 2018-10-10 10:43:26 -0600 )edit