Rewriting and Extending ROS Tutorial on reusing map

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

Rewriting and Extending ROS Tutorial on reusing map

heimsi
The current description about reusing a map in the StereoHandHeldMapping tutorial is very short and in my opinion not very clear in how to proceed. I was able to figure out how, and I would like to use the gained knowledge to make life easier for other users... So I tried to write a description how to proceed.

My questions are: Are there any errors / unnecessary steps described, or any information incorrect? Is that fine if I add that to the ros tutorial?

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

The current text:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


4.1 Advanced


You can also start the launch file above directly in Localization mode with a previously built database. Set the parameter "Mem/IncrementalMemory" to "false". Also, when starting the rtabmap node, the argument "--delete_db_on_start" must not be set!

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="">
       ...
       <param name="Mem/IncrementalMemory" type="string" value="false"/>
    </node>

In the GUI, do Edit->"Download map" to download the map from the rtabmap node. At the start, you should see that the current displayed cloud is not aligned to the map, it is normal because the odometry is reset on each start. By looking over locations in the map, RTAB-Map would localize itself in it by finding a loop closure. Once a loop closure is found, the odometry is corrected and the map will appear with the current cloud aligned to it.




@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

The Proposed Rewriting:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


5. Reusing a map



5.1 When building the map to reuse

---------------------
Once you built a map which you want to reuse later, pause the odometry with the button in rtabmapviz. Now you have to decide between the following two options:
- Option A: If you want to later reload the map as it is now (graph of the visited positions and the assembled point cloud):
        1. Choose Edit > Download All Clouds (update cache)
        2. In the appearing window choose "Global map optimized"
        3. Choose the rtabmap.db file in the appearing save dialog window.


- Option B: If you later need only to be able to relocalize without visulizing the full assembled point cloud of the current map:
        -> just terminate rtabmapviz, and all the necessary information will automatically be saved in ~/.ros/rtabmap.db

5.2 Reusing the map

--------------------
To launch RTAB directly in Localization mode with a previously built map, you have to:
- set the parameter "localization" to true
- do NOT set the option "--delete_db_on_start"

So:
   
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="">   
       ...
       <param name="localization" value="true"/>
    </node>

Once rtabmapviz has started:
If you have chosen option A in the first paragraph:
        1. Choose Edit >  Update Cache from a local database copy
        2. Select the previously saved rtabmap.db file
        3. Start to move the camera in a previously mapped location, and the camera should soon be able to relocalize itself.

If you have chosen option B in the first paragraph, omit step 1. and 2., and directly do step 3.
 


5.3 On coordinate frames in pre-built maps

Note, that when reusing a pre-built map, at the initialization of RTAB the origin of coordinate frame "odom" is set to the location where the camera is at that moment. The tf odom-->camera link will always be with respect to this origin.
Once RTAB has relocalized itself in the prebuilt map, the tf map-->odom will change from an identity transform to the transform from the prebuilt map's origin to the new odom coordinate system.





Reply | Threaded
Open this post in threaded view
|

Re: Rewriting and Extending ROS Tutorial on reusing map

matlabbe
Administrator
Hi,

Not sure to understand the purpose of section 5.1.

For 5.2, the rtabmap node doesn't have "localization" parameter, but the launch file does. As the tutorial is using the launch file and to avoid some confusion, I updated the section 4 with an example using "localization" argument of the launch file instead of the "Memory/IncrementalMemory" parameter of rtabmap node.

Using "Edit -> Update Cache from a local database copy" is an advanced task, as the normal way is just to download the data from rtabmapviz or from MapCloud plugin for RVIZ. That option is when we have big maps to load (>1GB) or we are over network. Feel free to add a subsection 4.2.1 for this option.

For 5.3, I added it to section 4.3.

thx for the comments,
Mathieu