ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Localization drifting when slam_gmapping with RosAria and MobileSim

asked 2019-11-05 07:53:28 -0500

fendrbud gravatar image

updated 2019-11-05 08:04:13 -0500

I'm working on a Pioneer LX robot and I'm currently trying to use slam_gmapping to create a map of an existing .map file by driving the robot around in the MobileSim simulator using the rosaria_client. However, I experience som weird errors when monitoring the map and laserscan in rviz. Initially, the map and the readings from the laserscan seem to overlap pretty well, but after driving around some obstacles and returning to the point I started the localization is totally off (see the images below). It seems to have lost some angular odometry after a while.

Images: MobileSim image and corresponding RVIZ image.

Are these tuning related issues? Since I use a simulator I assume that the sensors are tuned "perfectly". Any ideas of what's causing this?

edit: The error seems to occur if I rotate the robot a lot (>100 degrees ish) in one movement...

Some (maybe) relevant code:


  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
    <remap from="scan" to="/RosAria/sim_S3Series_1_laserscan"/>
    <param name="odom_frame" value="odom"/>
    <param name="base_frame" value="base_link"/>
    <param name="map_frame" value="map"/>
    <param name="throttle_scans" value="1"/>
    <param name="maxUrange" value="5.0"/>
    <param name="maxRange" value="10.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="1"/>
    <param name="lstep" value="0.05"/>
    <param name="astep" value="0.05"/>
    <param name="iterations" value="5"/>
    <param name="lsigma" value="0.075"/>
    <param name="ogain" value="3.0"/>
    <param name="minimumScore" value="0.0"/>
    <param name="lskip" value="0"/>
    <param name="srr" value="0.01"/>
    <param name="srt" value="0.02"/>
    <param name="str" value="0.01"/>
    <param name="stt" value="0.02"/>
    <param name="linearUpdate" value="0.1"/>
    <param name="angularUpdate" value="0.05"/>
    <param name="temporalUpdate" value="-1.0"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="10"/>
    <param name="xmin" value="-10.0"/>
    <param name="ymin" value="-10.0"/>
    <param name="xmax" value="10.0"/>
    <param name="ymax" value="10.0"/>
    <param name="delta" value="0.02"/>
    <param name="llsamplerange" value="0.01"/>
    <param name="llsamplestep" value="0.01"/>
    <param name="lasamplerange" value="0.005"/>
    <param name="lasamplestep" value="0.005"/>


<node pkg="amcl" type="amcl" name="amcl" output="screen">
  <remap from="scan" to="/RosAria/sim_S3Series_1_laserscan" />

  <param name="odom_model_type" value="diff"/>
  <param name="odom_alpha5" value="0.1"/>
  <param name="transform_tolerance" value="0.2" />
  <param name="gui_publish_rate" value="10.0"/>
  <param name="laser_max_beams" value="30"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <param name="kld_err" value="0.05"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.2"/>
  <param name="odom_alpha2" value="0.2"/>

  <param name="odom_alpha3" value="0.8"/> ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-06 12:09:31 -0500

cat_in_box gravatar image

I've experienced this exact issue with a Pioneer 3dx in a real world environment. In my case the robot base's odometry was a bit off and I needed to adjust parameters in AMCL to improve localization.

For what you're describing, check out this ROS navigation tuning guide, specifically section "5.2 Parameters for measurement and motion models". There's also a Navigation tuning guide on the ROS wiki.

Make sure you have a good understanding of AMCL 's odometry model parameters. Also found this answer helpful.

Good luck!

edit flag offensive delete link more


I will try your suggestions, however, I think it is weird how it localizes well for a given amount of time and then suddenly localizes wrong when rotating. I would assume that if the tuning is off, then the localization wouldn't work well up to the point where the error occurs?

Also, using amcl with gmapping is not necessarily required right? Since both gmapping and amcl provide localization. Is it even good to use two localization nodes?

fendrbud gravatar image fendrbud  ( 2019-11-07 06:55:47 -0500 )edit

Found a good question&answer thread here that might help:

Also, you should not be running amcl and gmapping at the same time. Use amcl to localize; use gmapping to make a map.

cat_in_box gravatar image cat_in_box  ( 2019-11-08 09:36:24 -0500 )edit

Question Tools

1 follower


Asked: 2019-11-05 07:53:28 -0500

Seen: 329 times

Last updated: Nov 06 '19