how can i know the robot have located itself?

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

how can i know the robot have located itself?

mantouRobot
Hi~
      when rtabmap is in localization mode, how can i know the robot have located itself? any signal will publish?
      thank u~
Reply | Threaded
Open this post in threaded view
|

Re: how can i know the robot have located itself?

matlabbe
Administrator
Hi,

It depends to what parameter "Rtabmap/StartNewMapOnLoopClosure" is set:

- "true": Easier to detect localization. The published /rtabmap/mapGraph would contain only 1 pose until the robot is localized, then the whole map's graph will be published (so poses > 1). You can also subscribe to /rtabmap/info topic and see if loopClosureId is not null (indicating a localization).
$ rostopic echo /rtabmap/info/loopClosureId

- "false": It is more difficult to detect because rtabmap is starting a new map and loop closures can be detected in its new map and with the old map. Detecting a loop closure with an old map would require to subscribe to /rtabmap/mapData and check the mapId set in the nodes sent in the topic corresponding to current graph poses. If a node in the graph has a map ID different from the latest node ID, then you know that rtabmap just merged two maps together.

cheers