Rosanswers logo

I'm rather new to ROS and using ROS with SLAM for the first time. I'm using a Hokuyo LIDAR and the gmapping package. My maps don't look very good. Specifically, there are two points I'm interested in:

  1. I've adjusted all the gmapping parameters that i can understand (update intervals, laser range, and map resolution--although I'm not even sure i know what map resolution does) but i'm wondering if some of the other parameters are playing a large part in the quality of my maps. Can someone link me to some resources that can help me understand the other parameters better?

  2. The map seems to be changing around the robot such that it only displays what the robot is currently seeing. My understanding was that gmapping worked like this, with the robot sort of moving around a fixed map. What are some steps i can take to get my mapping to operate as it does in that video?

To recap: I'd like to make nice, clean maps, but mine seem very clustered with particles everywhere (perhaps adjusting some filtering parameter can help here) and my map moves around the robot, not the other way around. Can anyone with some more SLAM experience help me out? I'd be happy to post some screenshots of my maps or provide any other info as needed.Thanks

Originally posted by Ryan_F on ROS Answers with karma: 71 on 2017-08-21

Post score: 1

Original comments

Comment by achmad_fathoni on 2018-06-09:
Do you find any resource about better explanation of gmapping parameters?


1 Answer 1


Rosanswers logo

I use a SICK laser scanner and use the default params for gmapping with very good results. I get the best results, however, when I drive around and turn slowly. It can take quite some time (> 45 minutes) to map a large space (> 2000 sq ft) with lots of pathways.

Now, slowly can mean different things for different people (or robots), but roughly it takes a few minutes / 100 sq ft. It also helps to go over problem areas a couple of times.

You may find that the first time you went over an area it doesn't look that great but after the second time it gets adjusted and looks better.

As for finding the right parameters for your robot, this can be more of an art than a science at times. However, if you record your laser scans in a bag file then run gmapping you'll be able to properly tune your system much more systematically and efficiently (by changing the params on the same data until you get optimal results).

In the book Programming Robots with ROS (pg 146), it is suggested to try playing with the following params first:

  • /slam_gmapping/agularUpdate to 0.1
  • /slam_gmapping/linearUpdate to 0.1
  • /slam_gmapping/lskip to 10
  • /slam_gmapping/xmax to 10
  • /slam_gmapping/xmin to -10
  • /slam_gmapping/ymax to 10
  • /slam_gmapping/ymin to -10

For more parameters and further explanation of the parameters that I listed, check out gmapping on the wiki.

In the video RViz is being used to display the map that gmapping is publishing to the map topic with map set as the fixed frame. If your map is moving around the robot then you probably have the fixed frame set to base_link (or equivalent for your robot).

Originally posted by jayess with karma: 6155 on 2017-08-21

This answer was ACCEPTED on the original site

Post score: 3

Original comments

Comment by gvdhoorn on 2017-08-22:
It might also be worthwhile to look into other mapping components, such as Google Cartographer (in 2D mode). That's not an answer to "how do I improve my gmapping", but gmapping is quite old already, so it might pay to look at more recent developments.

Comment by Ryan_F on 2017-08-25:
Thank you this turned out to be perfect advice! The speed at which i was operating the robot was a large factor in the mapping error. I will look into newer mapping components as well.

Comment by jayess on 2017-08-25:
Great. Glad it helped.

Comment by aarontan on 2018-05-20:
Could you please elaborate on what you mean by "if you record your laser scans in a bag file then run gmapping you'll be able to properly tune your system much more systematically and efficiently (by changing the params on the same data until you get optimal results)

Thanks, Aaron

Comment by jayess on 2018-05-20:
If you use live data to tune your system then you'll get different results each time, even with the same parameters. If you use the same data, then different results are from the parameters being changed and not the different data.


Your Answer

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