Ask Your Question
0

Gmapping does not correctly set up map size parameters [closed]

asked 2015-09-14 00:16:02 -0500

steph_v gravatar image

Hi,

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"/>
</node>

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

PARAMETERS
/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

NODES
/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.

map_load_time:
secs: 0
nsecs: 0
resolution: 0.0500000007451
width: 5120
height: 14592
origin:
position:
x: -5.0
y: -5.0
z: 0.0
orientation:
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.

link: http://answers.ros.org/question/11233...

link: http://answers.ros.org/question/56114...

link: http://answers.ros.org/question/30038...

Any help would be appreciated. Thanks.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by steph_v
close date 2015-09-14 02:01:43.779044

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-14 01:02:12 -0500

ahendrix gravatar image

The xmin, xmax, ymin and ymax parameters set the initial map size; not the final map size. If your sensor sees past the initial map bounds during the map-building process, gmapping will expand the map bounds to include the new data.

How large is the area you're trying to map?

edit flag offensive delete link more

Comments

Thanks ahendrix. The map is being used for short range path planning for a wheelchair. There is no limitation on where the wheelchair can travel so the total map area is potentially infinite, but I only want to keep/use map information in a ~5m radius around the chair.

steph_v gravatar image steph_v  ( 2015-09-14 01:40:30 -0500 )edit

gmapping keeps an aggregate of the entire area that it has seen, for the entire time that it has been running, and it's generally intended for large-scale navigation. I don't think it's appropriate for your application.

ahendrix gravatar image ahendrix  ( 2015-09-14 01:43:52 -0500 )edit

You may want to investigate a combination of the laser_scan_matcher and costmap_2d packages, or you may want to see if the hector project has something applicable.

ahendrix gravatar image ahendrix  ( 2015-09-14 01:45:29 -0500 )edit

Thanks for that. I'll have a look into those.

steph_v gravatar image steph_v  ( 2015-09-14 02:01:11 -0500 )edit

If it expands the initial map, does it have any impact?

rezenders gravatar image rezenders  ( 2020-12-03 12:18:00 -0500 )edit

Question Tools

Stats

Asked: 2015-09-14 00:16:02 -0500

Seen: 2,733 times

Last updated: Sep 14 '15