Transform from map to odom for robot using rtabmap

asked 2017-04-28 10:25:18 -0500

cluelessnigerian gravatar image

I built a custom robot using URDF and I'm trying to view the position of the robot using the "odom" published from rtabmap. I managed to create a transform from odom to base_footprint but when I run rtabmap I get the following warning:

Could not get transform from base_footprint to kinect2_rgb_optical_frame

I've tried to create the transforms within rgbd_mapping_kinect2.launch by changing my fixed frame to base_footprint and adding the following transforms:

   <node pkg="tf" type="static_transform_publisher" name="base_to_kinect" 
        args="0 0 0.1 0 0 0 base_link kinect2_link 100" /> 

   <node pkg="tf" type="static_transform_publisher" name="kinect2_base_link"
        args="$(arg optical_rotate) kinect2_base_link kinect2_link 100" />

My Kinect input for my robot model looks like this:

 <joint name="kinect2_in_joint"
       <insert_block name="origin"/>
       <parent link="${parent}"/> 
       <child link="kinect2_link"/>
     <link name="kinect2_link">
         <origin rpy="0 0 0" xyz="0 0 0"/>
        </scale="0.001 0.001 0.001"/>
         <material name="Kinect2Grey"/>
         <origin xyz="0 0 0" rpy="0 0 0" />
           </scale="0.001 0.001 0.001"/>

and my tf Tree looks like :

As you can see, kinect2_base_link isn't connected to kinect2_link. Could you plese help with this?

edit retag flag offensive close merge delete