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.