Updating map when doing localization in 3D lidar version

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

Updating map when doing localization in 3D lidar version

robertsenps
This post was updated on .
Hi all,

Does anyone know how to update the map (both 3d and 2d map) in the middle of the localization process? Is there any parameter that I can set to activate the map updating when doing localization?

Maybe the multi-session mapping technique is useful. But is there anything else that we can do to do the switching as seamless as we can do, and without using the GUI?

I tried to restart localization node and set Mem/IncrementalMemory to true in localization mode (which I don't use "--delete_db_on_start" arg), But the transform between map to odom is = 0. After I tried to set the IncrementalMemory param to false, it back to its last localization pose.

Any thoughts?

I'm using 3D lidar only.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Updating map when doing localization in 3D lidar version

matlabbe
Administrator
Hi,

You may try set_mode_localization and set_mode_mapping services, though it is simply changing the Mem/IncrementalMemory parameter like you did manually. I would have to do some tests about switching modes and what it is doing when no camera is used. My first guess is that a camera is required to make sure we have a strong loop closure between the sessions when switching from localization to mapping. However, if we know that robot is correctly localized using only lidar (like proximity detections found), I could check to let it add the link between the session. When switching from mapping to localization, normally it could just continue from current position without adding new nodes. This is something I didn't test a lot online, so I'll take a look to make it more seamlessly. In this post, we also discussed reloading database issue when switching from mapping to localization.

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

Re: Updating map when doing localization in 3D lidar version

matlabbe
Administrator
Hi,

I tested with simple turtlebot3 simulation with only 2D lidar. With lidar-only, we have to set "--RGBD/ProximityMaxGraphDepth 0" so that proximity detections are detected between the new and old map (assuming that the robot was correctly localized in the previous map before). Here is an example (I tested on ros2, but should also works on ros1):

1) Mapping (until yellow links appear, meaning that we are localizing on our map):


2) Switch to localization mode (using set_mode_localization service or in rtabmapviz Detection->Localization) then move around (we can see the map is not updated where we passed by on top right):


3) Switch to mapping mode (using set_mode_mapping service or in rtabmapviz Detection->Mapping) then map some the missing areas:


4) Switching again to localization mode:


5) Switch to mapping the third time:


6) We now have three sessions linked together, switching to localization to more around:


cheers,
Mathieu