Detect relocalization when reusing database

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

Detect relocalization when reusing database

heimsi
Hello,

In my project I am reusing prebuilt database files. I need to detect when RTAB has been able to localize itself in the prebuilt map.

One way to detect relocalization is to observe the transform from 'map' to 'odom', which changes to non-zero values when RTAB has relocalized itself.
But this detection method does not work, if the camera is placed at the same location at initialization of RTAB when building the map and when reusing the map. Because the tf from 'map' to 'odom' would stay 0 even after relocalization.

Is there another way to detect it? Does RTAB somehow signalizes that it was able to relocalize itself in the old map?

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

Re: Detect relocalization when reusing database

matlabbe
Administrator
Hi,

It is unlikely that map->odom is still exactly Identity transform after a relocalization unless we are in a simulated environment with perfect sensor readings or map optimization is done from the end of the graph (RGBD/OptimizeFromGraphEnd=true). You can know when a relocalization happens with rtabmap_ros/Info message if loopClosureId field is non zero:
$ rostopic echo /rtabmap/info/loopClosureId
0
---
0
---
0
---
14     <---- relocalization
---

cheers,
Mathieu