Gmapping initialmapsize problem


I try to make a good map with a simulation. I got a problem with the initialmap size setup. The envirement i’ll like to make is 2.5x3.6 m^2. But the initial map size in Rviz and so the map, is much bigger than that size. The environment itself has good sizes in Rviz but not the initialmap size. The problem about that is that the black particles of boundaries are very big when zoomed in.

Thanks for helping

Hello R_M,

You can change map resolution with parameter delta, it is map grid size in meters.
You can change initial map size with parameters xmax, xmin, ymax, ymin, they are map sizes in positive and negative directions on X and Y axes in meters.


Hi Lukasz,

I know that i can change these parameters with xmax ymax en the resolution with delta. But the settings of the initial map do not match with what i see in Rviz. The initalmap length is 23 meters vertical in Rviz and the settings are “max” and “min” 3 meters. So the vertical length of the initialmap must be 6 meters.

On the screen, the map seems to be finished, was the map size 23m also in initial state?
As initial state I mean when first laser scan is processed by gmapping.

The gmapping algorithm will increase map size as new areas are discovered, it is not possible to control map size while it is being built.


The map is indeed finished but the parameters for inital map size do not match with what i see in Rviz. The shown initialmap in Rviz is the grey surface

In the picture you can see that the made map is much bigger than is needed for the environment. I want that my pgn file in size match with my environment. The grey surface is to big. In my attention the grey surface size must decrease when with the xmax, xmin, ymax, ymin settings. Hopefully is my question clear now.

This is the map in gazebo:

Map is getting increased each time when robot moves to its border. The increase step is at least 10 meters. With initial size of 6x6 meters it may be instantly increased when it is created.
Maybe you should try to set bigger initial size to 10x10 meters to prevent in from expanding at the beginning.

Due to the auto expanding process, it is not possible to make map with exact same size as environment.