Adaptive Monte Carlo Localization

In this chapter, we are using the Adaptive Monte Carlo Localization (AMCL) algorithm for the localization. The AMCL algorithm is a probabilistic localization system for a robot moving in 2D. This system implements the adaptive Monte Carlo Localization approach, which uses a particle filter to track the pose of a robot against a known map.

The AMCL algorithm has many configuration options that will affect the performance of localization. For more information on AMCL, please refer to the AMCL documentation at http://wiki.ros.org/amcl and also at http://www.probabilistic-robotics.org/.

The amcl node works mainly with laser scans and laser maps, but it could be extended to work with other sensor data, such as a sonar or stereo vision. So for this chapter, it takes a laser-based map and laser scans, transforms messages, and generates a probabilistic pose. On startup, the amcl node initializes its particle filter according to the parameters provided in the setup. If you don't set the initial position, amcl will start at the origin of the coordinates. Anyway, you can set the initial position in rviz using the 2D Pose Estimate button.

When we include the amcl_diff.launch file, we are starting the node with a series of configured parameters. This configuration is the default configuration and the minimum setting needed to make it work.

Next, we are going to see the content of the amcl_diff.launch launch file to explain some parameters:

<launch>
  <node pkg="amcl" type="amcl" name="amcl" output="screen">
    <!-- Publish scans from best pose at a max of 10 Hz -->
    <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" />
    <!-- translation std dev, m -->
    <param name="odom_alpha3" value="0.8" />
    <param name="odom_alpha4" value="0.2" />
    <param name="laser_z_hit" value="0.5" />
    <param name="laser_z_short" value="0.05" />
    <param name="laser_z_max" value="0.05" />
    <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_lambda_short" value="0.1" />
    <param name="laser_model_type" value="likelihood_field" />
    <!--<param name="laser_model_type" value="beam"/> -->
    <param name="laser_likelihood_max_dist" value="2.0" />
    <param name="update_min_d" value="0.2" />
    <param name="update_min_a" value="0.5" />
    <param name="odom_frame_id" value="odom" />
    <param name="resample_interval" value="1" />
    <param name="transform_tolerance" value="0.1" />
    <param name="recovery_alpha_slow" value="0.0" />
    <param name="recovery_alpha_fast" value="0.0" />
  </node>
</launch>

The min_particles and max_particles parameters set the minimum and maximum number of particles that are allowed for the algorithm. With more particles, you get more accuracy, but this increases the use of the CPU.

The laser_model_type parameter is used to configure the laser type. In our case, we are using a likelihood_field parameter but the algorithm can also use beam lasers.

The laser_likelihood_max_dist parameter is used to set the maximum distance for obstacle inflation on the map, which is used in the likelihood_field model.

The initial_pose_x, initial_pose_y, and initial_pose_a parameters are not in the launch file, but they are interesting because they set the initial position of the robot when amcl starts; for example, if your robot always starts in the dock station and you want to set the position in the launch file.

Perhaps you should change some parameters to tune your robot and make it work fine. Visit http://wiki.ros.org/amcl, where you have a lot of information about the configuration and the parameters that you could change.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset