ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RTAB-Map: Merge local grid maps of multi-session mapping

asked 2020-10-23 14:17:46 -0600

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 rtabmap to 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 the rtabmap 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.

Is there a way to ask rtabmap to publish the global, merged 2D map during localization mode? Alternatively, is there a way to export the merged 2D map? I figured out how to export each individual map using rtabmap-databaseViewer (select the right 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 manual merging.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-10-24 11:54:03 -0600

While Miura's answer wasn't a solution per-se it pointed me in the right direction (thanks!).

I just found out that if you make this call:

rosservice call /rtabmap/publish_map true false false

rtabmap will successively publish all local maps on the above topic (including headers with origin), hence giving me a chance to capture them, merge them, and republish in merged form using map_server or similar. This is still not the ideal solution but to anyone facing the same issue it gets one unblocked.

edit flag offensive delete link more
0

answered 2020-10-24 00:07:13 -0600

miura gravatar image

You can also get a grid map with get_map. Maybe you can get a merged grid map. http://wiki.ros.org/rtabmap_ros#line-...

edit flag offensive delete link more

Comments

Thanks for the suggestion, but unfortunately that doesn't give me anything different from what's already published on /rtabmap/grid_map.

chfritz gravatar image chfritz  ( 2020-10-24 11:43:26 -0600 )edit

I'm glad to hear that it helped indirectly.

miura gravatar image miura  ( 2020-10-25 05:17:21 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-23 14:17:46 -0600

Seen: 757 times

Last updated: Oct 24 '20