Gmapping failure culprit -- parameters, odometry, sensors?
Hello,
I am running ROS Hydro on a Turtlebot 2 (Kobuki + Kinect)
I have been trying to use teleop + gmapping to get a decent map of my cubicled office building, but after slowly perimeter-driving and looping back through several hallways, inevitably, the map will eventually do something absurd like this:
I started with the first two hallways on the right, constantly weaving in and out of cubicles and repeating areas. The picture of those hallways really isn't bad, but when I started exploring the third vertical hallway after 30+ minutes, gmapping suddenly decided to create that horizonal hallway beginning to form on the bottom-left, which is extremely off. Anything after that point in time got progressively worse.
This happens fairly frequently when things seem to be going otherwise well.
The following are my gmapping parameters:
<launch>
<arg name="scan_topic" default="scan" />
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<param name="base_frame" value="base_footprint"/>
<param name="odom_frame" value="odom"/>
<param name="map_update_interval" value="2.0"/>
<param name="maxUrange" value="6.0"/>
<param name="maxRange" value="8.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="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.2"/>
<param name="angularUpdate" value="0.1"/>
<param name="temporalUpdate" value="-1.0"/>
<param name="resampleThreshold" value="0.5"/>
<param name="particles" value="100"/>
<param name="xmin" value="-30.0"/>
<param name="ymin" value="-30.0"/>
<param name="xmax" value="30.0"/>
<param name="ymax" value="30.0"/>
<!--
<param name="xmin" value="-1.0"/>
<param name="ymin" value="-1.0"/>
<param name="xmax" value="1.0"/>
<param name="ymax" value="1.0"/>
-->
<param name="delta" value="0.05"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
I have changed very little from the default turtlebot configuration, besides lowering the linear/angular update, slightly increasing the number of particles, and decreasing the map update interval.
Since I know that a failure in scan matching causes gmapping to rely on odometry, I wonder if my odometry is decent enough. I ran the test suggested in the navigation tuning guide ( http://wiki.ros.org/navigation/Tutori... ):
- I booted up
minimal.launch
,keyboard_teleop.launch
,gmapping_demo.launch
, andview_navigation_app.launch
- In rviz, I set the global frame to odom, turned off all costmaps, and put the decay time on /scan to 600s.
I did all the following tests at the lowest teleop speed.
This is the result of performing three rotations in my standard-sized cubicle:
Entrance to cubicle, staring at wall ~5ft away:
Drove straight towards wall:
Circled ...
Looking at the images you posted, it seems like the odometry isn't very good, so maybe using higher values of parameters srr, str and in particular of srt and stt could help... Can you try? Moreover the kinect sensor has a small fov and obviously a laser scan with larger fov would perform much better.
Is there any good way to figure out exactly how much str, etc should be changed? The method I'm using (accumulating laser scans with odom as the fixed frame) won't visibly reflect those changes...
Just try to move around the robot and see map result... i would rise srt and stt to something like 0.5 and the other two to 0.2... Otherwise, did you try to use those parameters? https://github.com/turtlebot/turtlebot_apps/blob/hydro/turtlebot_navigation/launch/includes/gmapping.launch.xml
The link is broken, but if you see the default turtlebot gmapping file I posted above, srr = 0.01, srt = 0.02, str = 0.01, stt = 0.02. I will try your suggestions.
My question was about seeing it line up to know I have them at good values, since those params affect gmapping and not my method of raw laserscans and odometry. Maybe launching gmapping with a particle count of 1 would show how good the alignment is?