This module handles how the entire navigation stack boots up, manages its running state, and tracks where the robot is located inside the static map.
1. Lifecycle Nodes (Managed Nodes)
A fundamental ROS 2 design feature. In Nav2, nodes do not just start running blindly when launched. They transition through strict, predictable states managed by a lifecycle controller.
- The States: Unconfigured -> Inactive -> Active.
- Why it matters: This ensures the Planner Server, Controller Server, and Costmaps all boot up, load their parameters, and sync their network connections perfectly before the robot is allowed to physically move. If one component fails to configure, the whole system halts safely.
2. AMCL (Adaptive Monte Carlo Localization)
The standard localization node used during navigation when you are not running a live, active SLAM node.
- How it works: It reads the static map generated by your past SLAM session and listens to your wheel
/odomand live/scan(LiDAR) topics. - The Particle Filter: It drops hundreds of virtual "guesses" (particles) onto the map. As the robot moves, it compares what the real LiDAR sees with what each virtual particle should see on the map. It deletes bad guesses and groups the particles together around the true location, constantly updating the mathematical transform from the
mapframe to theodomframe.