How it works…

Here, we are using the amcl_diff.launch file since our robot has a differential drive platform or model. Moreover, we will discuss some of the parameters in the amcl_diff.launch file:

<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>

Here, the min_particles and max_particles parameters set the minimum and the maximum number of particles allowed for the algorithm. With more particles, accuracy will increase, but this will also increase CPU usage.

The laser_model_type parameter configures the laser type. We are using the likelihood_field parameter here, but the algorithm can also use beam lasers.

Interestingly, the initial_pose_x, initial_pose_y, and initial_pose_a parameters are not in the launch file, although they set the initial position of the robot when amcl starts. For example, if we want, our robot could always start in the dock station; we have to set this position in the launch file.

In addition, we can refer to http://wiki.ros.org/amcl, which has a lot of information about the configuration and parameters for amcl.

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

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