Ask Your Question

gmapping & laser_scan_matcher slow vs hector slam

asked 2016-03-28 04:48:46 -0600

MarkyMark2012 gravatar image

updated 2016-03-29 16:58:10 -0600


I've been trying to get a reliable map from hector_slam and gmapping using an XTION Pro.

Hector_slam creates a very accurate map but because of the slow frame rate suffers if the robot turns quickly "angle change too large"

So I have then tried using gmapping fused with laser_scan_matcher. This produces a poor quality map and is very slow to update between 5-10 seconds.

gmapping launch config (Update 1):

<!--include file="$(find ardros)/launch/ardros_configuration.launch"/-->

<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="scre$
    <remap from="scan" to="base_scan"/>
    <param name="odom_frame" value="odom"/>
    <param name="map_update_interval" value="1"/>
    <param name="maxUrange" value="6.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="1"/>
    <param name="lstep" value="0.1"/>
    <param name="astep" value="0.1"/>
    <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.05"/>
    <param name="angularUpdate" value="0.1309"/>
    <param name="temporalUpdate" value="-1.0"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="100"/>
    <param name="xmin" value="-50.0"/>
    <param name="ymin" value="-50.0"/>
    <param name="xmax" value="50.0"/>
    <param name="ymax" value="50.0"/>
    <param name="delta" value="0.025"/>
    <param name="llsamplerange" value="0.01"/>
    <param name="llsamplestep" value="0.01"/>
    <param name="lasamplerange" value="0.005"/>
    <param name="lasamplestep" value="0.005"/>
    <param name="minimumScore" value="50"/>
    <!--param name="throttle_scans" value="2"/-->

image description

Hector SLAM Map image description

Gmapping image description

Any suggestion re: what can I do to improve the results?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-28 05:17:41 -0600

what "very slow to update" means to you? :-)

Gmapping has a lot of parameters, and you need to fine-tune them depending on your hardware configuration... I usually start with n#particles, angular/linear update if the odometry is good, lskip and map_update_interval.

300 particles is an HUGE number! Having 0.05m/5 cm resolution inside a 100x100m map, this means a lot of computational efforts (you are replicating x300 the map inside the memory). If you have a good odometry, try lowering that number to something like 80. Moreover, how many beams do you have in each scan? Actually you don't usually need to use all of them. Skipping some beams should improve the results and allow better performances.

Moreover, have a look to the system CPU load, if it's always 100% (gmapping is not multi-threading [1]) then your system will be very slow...


edit flag offensive delete link more


Cheers _ My odom is being derived from a gyro and laser_scan_matcher. I'll try lowering the partials. Do you know what turtlebot this will be similar.

MarkyMark2012 gravatar image MarkyMark2012  ( 2016-03-28 05:32:44 -0600 )edit

5-10 seconds.I still think that 300 particles are too much! I used that kind of number but recording everything in a bag file and then executing gmapping with a 0.1 replay speed. The problem here is in the queue, gmapping won't process every received scan if "it's busy" with a previous computation

Augusto Luis Ballardini gravatar image Augusto Luis Ballardini  ( 2016-03-28 05:38:54 -0600 )edit

Dropped it to 80 - faster - but still not as clear as H/S

MarkyMark2012 gravatar image MarkyMark2012  ( 2016-03-28 06:31:28 -0600 )edit

clear means detailed, with more resolution? I never used Hector_slam and I don't know its resolution, maybe you can increase the gmapping map resolution (delta parameter, 0.05 > 0.01) and lower the occ_thresh from 0.25 (default) to 0.20. If you can, try the BAG trick.

Augusto Luis Ballardini gravatar image Augusto Luis Ballardini  ( 2016-03-28 09:13:10 -0600 )edit

I've updated the parameters (Updated in original question). Map is updating faster. But now I'm gettin many "Scan Matching Failed, using odometry" messages.

Am I expecting too much with this "laser scanner" - from what I can tell the turtle bot manages okay

MarkyMark2012 gravatar image MarkyMark2012  ( 2016-03-29 16:56:42 -0600 )edit

it seems that your robot is moving too fast with respect to the speed the algorithm. the problem may be caused by the higher resolution of the map with respect to your first experiment. Try with the standard value for the particles, 30, just to debug/understand if this parameter was the problem.

Augusto Luis Ballardini gravatar image Augusto Luis Ballardini  ( 2016-03-30 08:31:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-03-28 04:48:46 -0600

Seen: 2,032 times

Last updated: Mar 29 '16