Atlas Robotics
LocalizationIntermediate

AMCL in Nav2: practical configuration of the amcl package

Atlasbot · 17/8/2026 · 11 min read

AMCL in Nav2: practical configuration of the amcl package
Amcl node lifetime in Nav2 — from initial Set Pose to convergence

What is AMCL? ( Robotics Fundamentals column) explained particle filter at the theoretical level. This unit is a practical section in the Nav2 ecosystem: how the node amcl real-world configuration is, and a commonly neglected step — "Set Pose" at boot time.

Key concepts

Node amcl in Nav2 configured via the main YAML parameters:

amcl:
  ros__parameters:
    min_particles: 500
    max_particles: 2000
    initial_pose: {x: 0.0, y: 0.0, yaw: 0.0}
    laser_max_range: 12.0
    update_min_d: 0.2      # only update when the robot moves 0.2m
    update_min_a: 0.2      # or rotate sufficiently 0.2 rad
  • min_particles/max_particles— what is the lower/upper boundary of the KLD-sampling technique learned in the AMCL article? — The wider the space, the more flexible AMCL adjusts the computational load to the real-world uncertainty.
  • update_min_d/update_min_a— minimum motion threshold before re-running Update step — avoiding computational waste when the robot is nearly stationary, with nothing new to update

How it works

AMCL does not automatically know where the robot is at first startup — unless it provides initial_pose, default particles scattered randomly throughout the map, taking much longer to converge (or failing to converge properly if the medium has multiple regions of symmetry causing confusion — correct "multiple-hypothesis localization" problem mentioned in the AMCL article?).

ros2 topic pub /initialpose geometry_msgs/msg/PoseWithCovarianceStamped \
  "{pose: {pose: {position: {x: 1.0, y: 2.0}}}}"

As learned in Lifecycle Node , amcl is a Nav2 managed node —lifecycle_manager calling configure then activate in the correct order before another node (such as controller_server) starts using localization data from it, ensuring that no node receives positional data from an unready AMCL.

Finally: Always provides an approximate initialization position (via the parameter initial_pose or "2D Pose Estimate" in RViz2) rather than letting AMCL guess from scratch — save significant convergence time, and avoid the case where AMCL mistakenly converges to a wrong symmetric position in a map with a repeated layout (many identical rooms, e.g.).

Technical details

Formulas

The estimated convergence time depends on the accuracy of initial_pose— the closer to the real position, the fewer the number of update cycles required for the particle to cluster:

Convergence_cycles ≈ f(distance_from_initial_pose_to_ground_truth)

If initial_pose has a small error (tens of cm): convergence in a few update cycles
Without initial_pose (particles spread randomly over the entire map):
  required cycles grow with map area / the average area
  each particle can rule out after each update

Parameters

ParametersImplications
min_particles/max_particlesKLD - based load range
update_min_d/update_min_aMinimum motion threshold before update, avoiding computational waste
initial_poseThe more precise the — initialization point, the faster convergence
laser_max_rangeAMCL LiDAR scan range used for map matching

Practical applications

Tracking convergence across RViz2 (learned in RViz2): adding Display PoseArray to the topic /particlecloud— cluster particle cloud tightening around a position is the indication that AMCL has converged well; if the particle remains widely scattered after a period of travel, it may be an environmental indication lacking a clear geometrical specificity (correct the problem mentioned in LiDAR SLAM) or initial_pose is too far from ground truth. With the AMR booting from a fixed charging station, pre-setting initial_pose equal to the correct charging station coordinates in the launch configuration file makes it possible to completely skip the manual "2D Pose Estimate" step per boot.

Practical example

# Check if AMCL has published the pose, and the current covariance
ros2 topic echo /amcl_pose --once

# Continuous tracking to observe covariance decreasing as convergence
ros2 topic echo /amcl_pose | grep -A 3 covariance
Scenario: a robot starts without initial_pose in a warehouse with
3 corridors that are identical in shape.

Without initial_pose:
  → particles spread over the entire map, including all 3 corridors
  → AMCL may converge INCORRECTLY to one of the other corridors
  → the robot navigates using a wrong pose, resulting in entirely wrong behavior

Provide initial_pose in the correct startup region:
  → particles are concentrated around that region from the start
  → avoids confusion with the other 2 identical corridors
  → converges quickly and correctly to the actual position

Common mistakes

  • Failing to provide initial_pose for the robot to start in the previously known position— as the above example, can cause AMCL to converge mistakenly into the wrong symmetric position in environments with a repeated layout.
  • Set min_particles too low for large— environments decreases the ability of the particle to cover the initial positional hypothesis sufficiently, especially in the absence of the correct initial_pose.
  • Do not check /particlecloud over RViz2 before trusting that AMCL has converged— starting navigation based on the assumption of "probably fine" rather than intuitive confirmation of particle cloud clustering shrinkage.
  • Skipping the order of lifecycle configure/activate when debug— is falsely suspected at another node while AMCL is intrinsically not yet activated in the correct order by lifecycle_manager.

Conclusion

The AMCL configuration in Nav2 is not only the filling of the YAML parameter — that properly provides initial_pose and the visual confirmation of convergence over /particlecloud prior to the start of navigation that is equally important operational practice as understanding particle filter theory. The next article in the column goes into EKF in Nav2 — how robot_localization coordinates to the AMCL itself configured here.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

AMCL in Nav2: practical configuration of the amcl package — Atlas Robotics