It seems like you just didn't set any parameters for gmapping. I guess you were not running it using a launch file but rosrun. Just running a node normally will not set anything on the parameter server, the node will just use the default values as documented at the gmapping wiki page. To actually set parameters, the most common way is to use a launch file. There are a few packages that contain launch files to start gmapping, e.g. in pr2_navigation_slam
or in turtlebot_navigation
.
You can create a file gmapping.launch
and put the following content in it:
<launch>
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<rosparam>
odom_frame: odom
map_update_interval: 1.0
maxUrange: 30.0
maxRange: 60.0
sigma: 0.05
kernelSize: 1
lstep: 0.05
astep: 0.05
iterations: 5
lsigma: 0.075
ogain: 3.0
lskip: 0
linearUpdate: 0.5
angularUpdate: 0.436
temporalUpdate: -1.0
resampleThreshold: 0.5
particles: 80
xmin: -1.0
ymin: -1.0
xmax: 1.0
ymax: 1.0
delta: 0.025
llsamplerange: 0.01
llsamplestep: 0.01
lasamplerange: 0.005
lasamplestep: 0.005
base_frame: base_link
</rosparam>
<remap from="/scan" to="/base_scan" />
</node>
</launch>
Have a look at the remap line at the end. You need to replace the topic base_scan
by whatever topic your laser publishes to. If that happens to be scan
you can just remove that line. Also, make sure that the odom_frame
and the base_frame
match your configuration.
Now you should be able to execute roslaunch gmapping.launch
. After that call, the gmapping parameters should all be shown by rosparam list
.
Note that rosparam set
won't change anything for roslaunch or gmapping since roslaunch will overwrite the parameters again and gmapping parses them only when it's started up. If you want to change parameters, edit the launch file.