Multi-session Localization - 2D map does not update

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

Multi-session Localization - 2D map does not update

enthusiastrobotics
This post was updated on .
Hello!

I am trying to do some multi-session mapping, and then localization in a small area with 2 floors (not connected), on the turtlebot. The mapping goes well, and when localized I can do the navigation just fine. I am using ROS Kinetic, Ubuntu 16.04, and the latest version from github from source.

I'm using the launch file for the turtlebot_mapping demo, where I use the 3dsensor.launch file to create laserscans from depth image.

The problem is that if I switch floors in localization mode (i.e., lift the robot and move it to the other floor), the Rtabmap clouds update on loop closure but the 2D map does not.
Then I get this really weird view in RViz, where the 3D cloud does not match the 2D mapping, as in the Figure below.



In this image, it has the correct 3D map cloud, but it has the 2D map from the previous floor.

For some reason, the only thing fix that I could find is to completely restart rtabmap, and then the robot localizes and updates the 2D map (the exact same position for the turtlebot. I just ctrl+C'd rtabmap in terminal, and launched again):


Is there any way to do this without having to turn OFF and ON rtabmap?
I tried clearing costmaps through the move_base service, but it did not work. I also tried running several rtabmap services (get_grid, etc..) but it did not work either.

I don't understand this problem, as the robot is clearly able to localize itself (the rtabmap cloud updates), it is just that for some reason the grid map does not while rtabmap is open (if I restart rtabmap it uses the correct grid map).

If it helps, I am getting this warning on boot:
Setting "Grid/FromDepth" parameter to false (default true) as "subscribe_scan" or "subscribe_scan_cloud" is true.
The occupancy grid map will be constructed from laser scans.
To get occupancy grid map from cloud projection, set "Grid/FromDepth" to true.
To suppress this warning, add param name="Grid/FromDepth" type="string" value="false"
But I imagine this is normal since I am using the depthimage_to_laserscan in the 3dsensor.launch file?

Thank you in advance!


EDIT1: Here is the weirdest thing! For some reason it IS able to fully localize (i.e. update 3d cloud AND 2d map) if I start it in the 1st Map and then move it to the 2nd map. But it does NOT work if I start it in the 2nd map and then move it to the 1st map (in which case I get the problem shown in the pictures).
By 1st map I mean that it is the first map that was recorded  in my multisession.
By 2nd map I mean that it is the second map that was captured in my multisession.

I also have the following options which may influence this:

          param     if="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="false"/>
          param unless="$(arg localization)" name="Mem/IncrementalMemory" type="string" value="true"/>
          param name="Mem/InitWMWithAllNodes" type="string" value="$(arg localization)"/>





Reply | Threaded
Open this post in threaded view
|

Re: Multi-session Localization - 2D map does not update

matlabbe
Administrator
Hi,

Thank you for the detailed description. The bug is fixed with the latest commits(this one, and this one). Make sure to update rtabmap and rtabmap_ros projects.

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

Re: Multi-session Localization - 2D map does not update

enthusiastrobotics
Perfect! That did the trick, thank you!