Limiting Localization to Stay Within Map Boundaries in RTAB-Map

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Limiting Localization to Stay Within Map Boundaries in RTAB-Map

rob_slam
Hi everyone,

I'm currently working on a project using RTAB-Map for localization. While the localization within a previously created map works fine initially, I often encounter an issue when I continue moving around: the localization drifts outside the map boundaries. Most of the time, the robot appears to be positioned somewhere outside the map (after correct first-localization in the map).

Is there a way to configure RTAB-Map to ensure that localization remains confined within the map? Essentially, I’d like to prevent the system from placing the robot in positions outside the pre-built map during localization.

I’d greatly appreciate any advice or suggestions on parameters or methods to address this issue. Thanks in advance!

Best regards
Reply | Threaded
Open this post in threaded view
|

Re: Limiting Localization to Stay Within Map Boundaries in RTAB-Map

matlabbe
Administrator

The /rtabmap/localization_pose topic would publish a pose with covariance. If the robot didn't localize for a while the covariance should grow over time, and only shrink when a re-loclaization happens. You may monitor that covariance to know if the robot is "lost" (i.e., if variance > some threshold).

Are you using only cameras, lidar or both? Ideally, we would want to make sure rtabmap is able to re-localize periodically to avoid this issue.
Reply | Threaded
Open this post in threaded view
|

Re: Limiting Localization to Stay Within Map Boundaries in RTAB-Map

rob_slam
Thank you matlabbe.

I have only a Stereo Camera (with an integrated IMU).
RTAB Localizes correct at the start of the system but looses the correct position after moving forwards (see blue line in picture - green is the correct path of the complete map [map is disabled in picture]).
It would be perfect to "re-localize periodically" to avoid my issue - but how can this be implemented? What RTAB Map Settings are needed? Right now it localizes only once (at the start of the localization).

Thank you in advance.