Rosanswers logo


I have generated map.pgm with gmapping using teleoperation and RPLidar, and I am using this map for navigation stack. The problem is, since the environment (indoor office) changes a lot, it struggles with amcl which causes inaccurate navigation. It works okay when there are minor changes but when the desk is moved or some chairs are moved to other side, it struggles.

image description

I believe there are three possible options for this problem, (If there are other good solutions please let me know, thank you!)

  1. re generate the whole map using gmapping and teleportation -> easy but time consuming (not what I want to do)
  2. re generate the whole map using gmapping & exploration (auto-SLAM & auto-Navigation) -> couldn't find a good solution (have tried explore_lite but it kept going under the desk or get stuck due to clustered environment)
  3. use the previous map and and set some points on the map that robot should visit & update the map during this process.

I was wondering if there is a way to do the third option. I can create a node that sends out move_base goals and my navigation stack works. Is there any way to update already made map (made by gmapping) ?

Since the already-made map used by navigation stack will be published by map_server, if there is a way to update the map and then save the map by map_saver, i will be able to solve this problem. Thank you for your help!

Originally posted by So Young on ROS Answers with karma: 118 on 2021-01-19

Post score: 1


1 Answer 1


Rosanswers logo

I've done option3 , and the important thing is to localize (AMCL) & visit points (move_base) the robot with 'previously built old map' and run gmapping at the same time (as I mentioned earlier in my Question, I made a node that publishes move_base goals- the visit points were selected before.). But make sure to change odom_frame param in slam_gammping node to odom2 or something (just to be different from default odom) so that gmapping doesn't interfere with the current odom used in move_base & AMCL at the moment.

Originally posted by So Young with karma: 118 on 2021-04-16

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by rezenders on 2021-05-12:
Can you please explain a little bit more how you did this? If I run the robot with 'previously built old map' and run gmapping at the same time the map is reset to a new one and I lose all the previously map data.

Comment by So Young on 2021-05-12:
Hi, I couldn't find a way to 'partially' update the previously built map. Instead, I worte a simple node that turns on the gmapping and publishes move_base goals and rotate every time it reaches each goal (for instance, visiting point A and rotate, then go to point B and rotate and then so on.. ) so I could imitate the key-operation mapping. whilst doing this, I made sure the gmapping odom frame was set to 'odom2' or something that is different to original 'odom' frame of the AMCL, so that it doesn't interfere with previous move_base or AMCL. after the mapping is done, you'll get a map of the area with 'same frame', and obviously this is a new map that can replace the previous map. However, in terms of changing the map partially, you can probably cut a part of this new map and then attach it to the previous map easily since it has the same frame system (direction and coordinates) using opencv or so? I decided to replace the old map with newly created map and it works well.

Comment by loveson on 2023-07-12:
do you launch slam and navigation on same rviz window or seperate rviz window for both?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.