Re: Synchronizing visual odometry with RTK GPS

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Synchronizing-visual-odometry-with-RTK-GPS-tp5448p5461.html

Hi,

It is possible to reset odometry at a specific pose with service /rtabmap/reset_odom_to_pose.

With robot_localization, I think you could use RTK+IMU as position estimation and visual odometry as velocity estimation. When RTK is not available, the pose will be computed from visual odometry velocities. For visual odometry node, you may set publish_null_when_lost to false so that when odometry is lost nothing is published. Set also Odom/ResetCountdown to 1 so that visual odometry is automatically reset when lost. publish_tf should be false with robot_localization.
<node pkg="rtabmap_ros" type="stereo_odometry" name="visual_odometry">
   ...
  <param name="publish_null_when_lost" value="false"/>
  <param name="publish_tf" value="false"/>
  <param name="Odom/ResetCountdown" value="1"/>
</node>


<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
   ...
      <!-- position from GPS... -->
   <param name="odom0" value="/your_state_estimation_gps_node_topic">
   <rosparam param="odom0_config">[true,  true,  false,
                                false, false, false,
                                false, false, false,
                                false, false, false,
                                false, false, false]</rosparam>
   <param name="odom0_differential" value="false"/>

   <!-- velocity for odometry... -->
   <param name="odom1" value="/rtabmap/odom">
   <rosparam param="odom1_config">[false, false, false,
                                      true, true, true,
                                      false, false, false,
                                      true, true, true,
                                      false, false, false]</rosparam>
   <param name="odom1_differential" value="true"/>
</node>

See http://docs.ros.org/melodic/api/robot_localization/html/integrating_gps.html for node publishing the GPS odometry.

ground_truth_frame_id and ground_truth_base_frame_id parameters are only used to initialize odometry with corresponding ground truth pose. For guess_frame_id, the guess frame id should be always valid, mainly used if the robot has wheel odometry.

cheers,
Mathieu