AMCL randomly loses localisation.
Hi,
I am using the `AMCL package with the following configuration:
<node pkg="amcl" type="amcl" name="amcl" clear_params="true">
<param name="use_map_topic" value="$(arg use_map_topic)"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="odom_alpha5" value="0.0"/>
<param name="gui_publish_rate" value="10.0"/>
<param name="laser_max_beams" value="30"/>
<param name="laser_max_range" value="-1.0"/>
<param name="laser_min_range" value="-1.0"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="5000"/>
<param name="kld_err" value="0.01"/> <!-- 0.05-->
<param name="kld_z" value="0.99"/>
<param name="odom_alpha1" value="4.0"/> <!-- 0.2-->
<param name="odom_alpha2" value="0.9"/> <!-- 0.2-->
<param name="odom_alpha3" value="0.2"/> <!-- 0.8 -->
<param name="odom_alpha4" value="0.2"/> <!-- 0.2-->
<param name="laser_z_hit" value="0.5"/>
<param name="laser_z_short" value="0.0"/>
<param name="laser_z_max" value="0.0"/>
<param name="laser_z_rand" value="0.5"/>
<param name="laser_sigma_hit" value="0.2"/>
<param name="laser_lambda_short" value="0.1"/>
<param name="laser_model_type" value="likelihood_field"/>
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="update_min_d" value="-0.2"/> <!-- 0.25 -->
<param name="update_min_a" value="-0.5"/> <!-- 0.2 -->
<param name="odom_frame_id" value="odom"/>
<param name="resample_interval" value="1"/>
<param name="transform_tolerance" value="0.3"/> <!-- 1.0 -->
<param name="recovery_alpha_slow" value="0.0"/>
<param name="recovery_alpha_fast" value="0.0"/>
The good thing is when the laser points matches exactly the map then the localisation is perfect, however when the laser points does not match exactly the map (even slight difference) the AMCL
tries correcting the robot's position on the map but it sets the robot in a completely wrong position.
I think it is something about the AMCL configuration but I do not know exactly which parameter.
Check your odometry first, see navigation troubleshooting
The odometry works fine, the problem is that the robot relies too much on the map for the localisation, therefore if the laser points are not exactly matching the map, you can see the robot location starts jumping all over the map trying to match the laser points with the map.