introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
966 stars 557 forks source link

Add the ability to reset map & keep map -> odom transform. #1066

Closed Krzo99 closed 10 months ago

Krzo99 commented 10 months ago

I think it would be usefull to be able to reset the whole map, but keep map -> odom transform, so new map would be drawn in Rviz2 where the last one ended. This could also be done the same way it's done with odom. A service, you can call to set map -> odom transform (reset_odom_to_pose).

Let me know what you think. Thanks.

matlabbe commented 10 months ago

Is it just for cosmetic purpose or for a multi-session workflow? The idea behind resetting the map is to restart from the current odometry pose. Unlike the odometry pose that we could arbitrary reset to any pose, the map->odom transform represents how much the graph has been corrected after loop closures, a map->odom with Identify tells us that there are no loop closures detected or if it stays close to Identity after loop closures, it would mean very low odometry drift. Faking a map->odom transform would mean that we add a loop closure correction that doesn't exist. The better way would be to have a node listening to map->odom, save the transform, reset the map so that map->odom will come back to Identity and publish back the saved transform under a new frame called world->map. If rviz's global frame is world, then if we reset the map from that intermediate node, the new map would appear restarting where we reset the map.

Krzo99 commented 10 months ago

For multi-purpose mapping. The idea is, to reser the map, when mapping new areas, to speed up & lower the merged map data. But I like the idea of having a world->map transform, that you adjust for each robot, when you reset the map.

matlabbe commented 10 months ago

I think world->map approach would make more sense. By the way, you can use /rtabmap/load_database service to create a new database online for convenience if you were not using it.