Merge local grid maps of multi-session mapping

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

Merge local grid maps of multi-session mapping

ChristianF
We have a large facility I want to map in stages. I've already created a decent map of a large portion of the facility but need to add additional rooms/corridors. I am able to continue mapping by starting on the existing map in localization mode, going to where I want to extend the map, setting mapping mode, and then going into the unknown (as recommended for multi-session mapping). This works but after a little while the occupancy grid map published on /rtabmap/grid_map is replaced by a new map that only shows the newly explored area. I understand from reading in this forum that this is expected, and that the old map may reappear on that topic when the robot is back in that old area and a loop closure is detected. But I still need the complete map for navigation.

Q1: Is there a way to ask rtabmap to publish the global, merged 2D map during localization mode?

Q2: Alternatively, is there a way to export the merged 2D map? I finally figured out how to export each individual map (database viewer > select the node in the graph view (this step wasn't obvious) > Regenerate optimized 2D map > Export optimized 2D map). So that's a starts, but these maps come without a yaml file containing the origin, so it's not clear how to align them for merging.

Thanks for your help!

Reply | Threaded
Open this post in threaded view
|

Re: Merge local grid maps of multi-session mapping

matlabbe
Administrator
Hi,

In localization mode, only the latest map (and all maps linked to it) will be published. When you switch to mapping mode, a new map is created. A loop closure may not be detected, so what you are seeing is the new map, with the old map disappearing. We can set the following parameter to true to make sure we have a loop closure before going in unknown areas:
Param: Rtabmap/StartNewMapOnLoopClosure = "false"          [Start a new map only if there is a global loop closure with a previous map.]

When loop closures are added between maps, the DatabaseViewer will show the maps merged together in GraphView.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Merge local grid maps of multi-session mapping

ChristianF
> When loop closures are added between maps, the DatabaseViewer will show the maps merged together in GraphView.

Thanks, Mathieu. That's the part that I was missing.

cheers,
Christian