# Rtabmap transform error with kinect

So I want to use rtabmap in order to map my environment. I am using Freenect to extract the data from the kinect using roslaunch freenect_launch freenect-registered-xyzrgb.launch Then i want to run roslaunch rtabmap_ros kinectlaser.launch where kinectlaser consists of the following link : kinectlaser.launch

Unfortunately I am encountering an TF error which says

[ WARN] [1477558055.097346892]: rtabmap: Could not get transform from base_link to camera_rgb_optical_frame after 0.200000 seconds (for stamp=1477558054.541588)!

[ERROR] [1477558055.097900220]: TF of received depth image 0 at time 1477558054.541588s is not set, aborting rtabmap update.

[ WARN] [1477558056.855120061]: rtabmap: Could not get transform from base_link to camera_rgb_optical_frame after 0.200000 seconds (for stamp=1477558056.609746)!

[ERROR] [1477558056.855669588]: TF of received depth image 0 at time 1477558056.609746s is not set, aborting rtabmap update.

Also when looking into my tf_view I can only see odom, base_footprint, base_link and specific topics for my roomba.

As can be seen in the tf tree this is because camera_rgb_optical_frame is not present in the tf tree

This is the same when using freenect.launch and freenect-registered-xyzrgb.launch. Probably the problem is within the freenect package. The best way to solve this is to add the following lines to /opt/ros/kinetic/share/freenect_launch/launch/freenect.launch:

<node pkg=" tf"  type=" static_transform_publisher" name="depth_frame" args="0 0 0 0 0 0 /base_link /camera_depth_frame 100"/>
<node pkg=" tf"  type=" static_transform_publisher" name="rgb_frame" args="0 0 0 0 0 0 /base_link /camera_rgb_optical_frame 100"/>


To see what the numbers mean please visit this link static-transform-publisher And finally you will also see the /camera_depth_frame and /camera_optical_rgb_frame in the tf tree.

In my image i attached them to the odom to make it easily visible but it is best to connect it to the base_link.

edit retag close merge delete

Sort by » oldest newest most voted

So after adding: <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 1 link1_parent link1 100" /> To my launch file it finally works. Although I am not sure if this is the best solution it is atleast a solution that works. I did this for the camera_rgb_optical_frame and the camera_depth_frame.

more

Yeah it looks to be a TF problem. To help better people answering your question, add your TF tree generated by "\$ rosrun tf view_frames" in the question.

( 2016-10-30 15:25:02 -0500 )edit

Strangely enough it now works even without the lines so guess it is fixed? edit: Now I have the same error I will add the screens and try to explain why this is happening

( 2016-10-31 07:16:40 -0500 )edit