Understanding AMCL

After building a map of the environment, the next thing we need to implement is localization. The robot should localize itself on the generated map. In this section, we will see a detailed study of the amcl package and the amcl launch files used
in Chefbot.

AMCL is probabilistic localization technique for robot working in 2D. This algorithm uses particle filter for tracking the pose of the robot with respect to the known map. To know more about this localization technique, you can refer to a book called Probabilistic Robotics by Thrun (http://www.probabilistic-robotics.org/).

The AMCL algorithm is implemented in the AMCL ROS package (http://wiki.ros.org/amcl), which has an amcl node that subscribes the scan (sensor_msgs/LaserScan), the tf (tf/tfMessage), the initial pose (geometry_msgs/PoseWithCovarianceStamped), and the map (nav_msgs/OccupancyGrid).

After processing the sensor data, it publishes amcl_pose (geometry_msgs/PoseWithCovarianceStamped), particlecloud(geometry_msgs/PoseArray) and tf (tf/Message).

The amcl_pose is the estimated pose of the robot after processing, where the particle cloud is the set of pose estimates maintained by the filter.

If the initial pose of the robot is not mentioned, the particle will be around the origin. We can set the initial pose of the robot in RViz using the 2D Pose estimate button. We can see the amcl launch file used in this robot. Following is the main launch file for starting amcl, called amcl_demo.launch:

<launch> 
  <rosparam command="delete" ns="move_base" /> 
  <include file="$(find chefbot_bringup)/launch/3dsensor.launch"> 
    <arg name="rgb_processing" value="false" /> 
    <arg name="depth_registration" value="false" /> 
    <arg name="depth_processing" value="false" /> 
     
    <!-- We must specify an absolute topic name because if not it will be prefixed by "$(arg camera)". 
    <arg name="scan_topic" value="/scan" /> 
  </include> 
 
  <!-- Map server --> 
  <arg name="map_file" default="$(find turtlebot_navigation)/maps/willow-2010-02-18-0.10.yaml"/> 
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" /> 
 
  <arg name="initial_pose_x" default="0.0"/> <!-- Use 17.0 for willow's map in simulation --> 
  <arg name="initial_pose_y" default="0.0"/> <!-- Use 17.0 for willow's map in simulation --> 
  <arg name="initial_pose_a" default="0.0"/> 
 
  <include file="$(find chefbot_bringup)/launch/includes/amcl.launch.xml"> 
    <arg name="initial_pose_x" value="$(arg initial_pose_x)"/> 
    <arg name="initial_pose_y" value="$(arg initial_pose_y)"/> 
    <arg name="initial_pose_a" value="$(arg initial_pose_a)"/> 
  </include> 
 
  <include file="$(find chefbot_bringup)/launch/includes/move_base.launch.xml"/> 
 
</launch> 

The preceding launch file starts the 3D sensors related nodes, the map server
for providing the map data, the amcl node for performing localization, and the move_base node to move the robot from the commands getting from higher level.

The complete amcl launch parameters are mentioned inside another sub file called amcl.launch.xml. It is placed in chefbot_bringup/launch/include. Following is the definition of this file:

<launch> 
  <arg name="use_map_topic"  default="false"/> 
  <arg name="scan_topic"     default="scan"/> 
  <arg name="initial_pose_x" default="0.0"/> 
  <arg name="initial_pose_y" default="0.0"/> 
  <arg name="initial_pose_a" default="0.0"/> 
 
  <node pkg="amcl" type="amcl" name="amcl"> 
    <param name="use_map_topic"             value="$(arg use_map_topic)"/> 
 
  ...................... 
  ...................... 
 
 
    <!-- Increase tolerance because the computer can get quite busy --> 
    <param name="transform_tolerance"       value="1.0"/> 
    <param name="recovery_alpha_slow"       value="0.0"/> 
    <param name="recovery_alpha_fast"       value="0.0"/> 
    <param name="initial_pose_x"            value="$(arg initial_pose_x)"/> 
    <param name="initial_pose_y"            value="$(arg initial_pose_y)"/> 
    <param name="initial_pose_a"            value="$(arg initial_pose_a)"/> 
    <remap from="scan"                      to="$(arg scan_topic)"/> 
  </node> 
</launch> 

We can refer the ROS amcl package wiki for getting more details about each parameter.

We will see how to localize and path plan the robot using the existing map.

Rerun the robot hardware nodes using the following command:

    $ roslaunch chefbot_bringup robot_standalone.launch  

Run the amcl launch file using the following command:

    $ roslaunch chefbot_bringup amcl_demo.launch map_file:=/home/lentin/room.yaml
  

We can launch RViz for commanding the robot to move to a particular pose on
the map.

We can launch RViz for navigation using the following command:

    $ roslaunch chefbot_bringup view_navigation.launch

The following is the screenshot of RViz:

Figure 12: Robot autonomous navigation using AMCL

We will see more about each option in RViz and how to command the robot in the map in the following section.

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

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