How to connect two disconnected tf trees?
Dear all,
My robot is based on a roomba, on top of which I placed a kinect v1. Ros melodic is the software I run, on an ubuntu 18.04 lts.
I'm trying to do mapping with rtabmap, I'm following this tutorial.
I'm stuck on this error: actually the tf tree is really splt in two (here the output of "rosrun tf view_frames")
[ WARN] [1607975443.437600036]: Could not get transform from base_footprint to camera_rgb_optical_frame after 0.200000 seconds (for stamp=1607975443.136633)! Error="Could not find a connection between 'base_footprint' and 'camera_rgb_optical_frame' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.200822 timeout was 0.2.".
I read I should apply a static transformation, so I added the line in the launch file... however it's still not working, I see this error:
Error: TF_NAN_INPUT: Ignoring transform for child_frame_id "odom" from authority "unknown_publisher" because of a nan value in the transform (0.000000 0.000000 0.000000) (nan nan nan nan)
at line 244 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
This is my launch file:
<launch>
<node pkg="tf" type="static_transform_publisher" name="link" args="0 0 0 0 0 0 0 camera_link odom 100" />
<!-- Kinect cloud to laser scan -->
<node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan">
<remap from="image" to="/camera/depth_registered/image_raw"/>
<remap from="camera_info" to="/camera/depth_registered/camera_info"/>
<remap from="scan" to="/kinect_scan"/>
<param name="range_max" type="double" value="4"/>
</node>
<!-- SLAM -->
<group ns="rtabmap">
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<param name="frame_id" type="string" value="base_footprint"/>
<param name="subscribe_depth" type="bool" value="true"/>
<param name="subscribe_scan" type="bool" value="true"/>
<remap from="odom" to="/odom"/>
<remap from="scan" to="/kinect_scan"/>
<remap from="rgb/image" to="/camera/rgb/image_rect_color"/>
<remap from="depth/image" to="/camera/depth_registered/image_raw"/>
<remap from="rgb/camera_info" to="/camera/rgb/camera_info"/>
<param name="queue_size" type="int" value="10"/>
<!-- RTAB-Map's parameters -->
<param name="RGBD/ProximityBySpace" type="string" value="false"/>
<param name="RGBD/AngularUpdate" type="string" value="0.01"/>
<param name="RGBD/LinearUpdate" type="string" value="0.01"/>
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
<param name="Reg/Force3DoF" type="string" value="true"/>
<param name="Vis/MinInliers" type="string" value="12"/>
</node>
</group>
</launch>
Do you have any suggestion? I'm not quite sure the approach to link the two branches of the tf tree is the most appropriate: please suggest what's the best approach to do so, I admit this is quite an overshooting for a beginner with ros like me.
Thanks