Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Gmapping does not correctly set up map size parameters


I am using gmapping in ros indigo for the first time (using Hokuyo URG-04LX-UG01 laser scanner and wheel encoders), but I am having problems setting the map size. I am trying to create a 10x10m map with a resolution of 0.05m as an initial test run. I run the gmapping node using this node description in the launch file:

<node pkg = "gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
    <param name="map_update_interval" value="2.0"/>
    <param name="maxUrange" value="5.0/>
    <param name="xmin" value="-5.0"/>
    <param name="ymin" value="-5.0/>
    <param name="xmax" value="5.0"/>
    <param name="ymax" value="5.0/>
    <param name="delta" value="0.05"/>
    <param name="maxRange" value="6.0"/>

When the gmapping node launches, at first the parameters seem to initialise correctly.

/rosdistro: indigo
/rosversion: 1.11.10
/slam_gmapping/delta: 0.05
/slam_gmapping/map_update_interval: 2.0
/slam_gmapping/maxRange: 6.0
/slam_gmapping/maxUrange: 5.0
/slam_gmapping/xmax: 5.0
/slam_gmapping/xmin: -5.0
/slam_gmapping/ymax: 5.0
/slam_gmapping/ymin: -5.0

/slam_gmapping (gmapping/slam_gmapping)

However, when I check the map metadata using rostopic echo, I get a map of size 5120x14592. The resolution is correct. I have noticed that each time I launch the gmapping node, the size of the map changes but it is never 10x10 as I intended. The same size problems are reflected when I view the map in rviz.

secs: 0
nsecs: 0
resolution: 0.0500000007451
width: 5120
height: 14592
x: -5.0
y: -5.0
z: 0.0
x: 0.0
y: 0.0
z: 0.0
w: 1.0

I have seen this issue posted on ros forums before, however I believe I am setting up the launch file as advised and it still doesn't work.




Any help would be appreciated. Thanks.