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