tf works only in one way
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!
EDIT:
here is an image of rqt_tf_tree
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
tocamera_link
tf?I added the rqt_tf_tree image. I did not use tf static_transform_publisher, I will try it, thanks.
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 errorI increased the publish rate to 1000Hz and this error is gone, but now I get the original error again.