ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to make better maps using gmapping?

asked 2017-08-21 15:46:07 -0500

Ryan_F gravatar image

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

edit retag flag offensive close merge delete


Do you find any resource about better explanation of gmapping parameters?

achmad_fathoni gravatar image achmad_fathoni  ( 2018-06-09 09:14:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-21 17:22:40 -0500

jayess gravatar image

updated 2017-08-21 19:24:52 -0500

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).

edit flag offensive delete link more



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.

gvdhoorn gravatar image gvdhoorn  ( 2017-08-22 02:07:43 -0500 )edit

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.

Ryan_F gravatar image Ryan_F  ( 2017-08-25 13:28:57 -0500 )edit

Great. Glad it helped.

jayess gravatar image jayess  ( 2017-08-25 13:38:46 -0500 )edit

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

aarontan gravatar image aarontan  ( 2018-05-20 10:34:48 -0500 )edit

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.

jayess gravatar image jayess  ( 2018-05-20 12:07:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-08-21 15:46:07 -0500

Seen: 5,526 times

Last updated: Aug 21 '17