Limiting Localization to Stay Within Map Boundaries in RTAB-Map

classic Classic list List threaded Threaded
4 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.

Reply | Threaded
Open this post in threaded view
|

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

matlabbe
Administrator
The blue line doesn't seem to be localized. By "re-localize periodically", I mean the robot should revisit locations in the map to re-localize. If the robot goes in a totally different corridor, it won't re-localize in that unknown corridor. Same issue would happen if the robot is navigating in a corridor that was mapped in other direction, the robot won't re-localize on images taken with a too different point of view than during the mapping. That is why I asked if there was only 1 camera looking in one direction or if lidar could be also used when mapping.

RTAB Localizes correct at the start of the system but looses the correct position after moving forwards
I cannot see that in that image as explained above. It feels it has never been localized from the start.