ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi Tanmay,

There is a RTAB-Map's parameter in stereo_odometry node that can automatically reset odometry after a number of frames lost.

  • Odom/ResetCountdown (default 0): Automatically reset odometry after X consecutive images on which odometry cannot be computed (value=0 disables auto-reset). In the launch file:
    <param name="Odom/ResetCountdown" type="string" value="0"/>

This parameter will make the odometry reset after X frames to Identify transform. When rtabmap node detects an Identity transform, a new map is created automatically. The previous map will disappear (from RVIZ or rtabmapviz) but it is still in memory, so if the robot comes back in the area of the previous map(s) AND detects a loop closure, the maps will be merged together (and the previous map will show up again in RVIZ or rtabmapviz).

In this approach, the odometry is reset to Identity, the robot may think that it jumped back to its initial position. If you want the odometry to reset to the last known pose (while creating a new map), you should do it externally like in your example:

  • If (2) is true, call /rtabmap/trigger_new_map then /rtabmap/reset_odom_to_pose (rtabmap_ros/ResetOdom). You don't have to call /rtabmap/backup.

If you have an IMU, you may track the position when the visual odometry is lost, and call directly /rtabmap/reset_odom_to_pose to the last estimated pose from the IMU without calling /rtabmap/trigger_new_map. No new map will be created, it will be like it is continuing mapping the same map.

cheers,

Mathieu