ROS 2 Navigation2 is a modular software framework that provides a complete autonomous navigation stack for wheeled mobile robots. Its core function is to perform global path planning, local trajectory planning, and motion control while integrating localization data (typically from SLAM or AMCL) to safely navigate in dynamic environments. The system is architected around a behavior tree for robust task execution and failure recovery.
Glossary
ROS 2 Navigation2

What is ROS 2 Navigation2?
ROS 2 Navigation2 is the official, behavior tree-based navigation framework for the Robot Operating System 2 (ROS 2), enabling mobile robots to autonomously move from a start to a goal location.
The framework's key components include the Planner Server, Controller Server, Behavior Server, and BT Navigator. It uses costmaps (grid-based representations of obstacles) for planning and leverages ROS 2's Data Distribution Service (DDS) for real-time, reliable communication. Navigation2 is highly configurable, supports multi-robot operations, and is designed for production-grade deployment in logistics, service robotics, and industrial automation.
Core Architectural Features
ROS 2 Navigation2 is a modular, behavior tree-driven framework that decomposes autonomous navigation into a series of composable, state-aware servers. Its architecture is defined by several key components that manage localization, planning, and control.
Behavior Tree Engine
The Behavior Tree Engine is the central executive that orchestrates the navigation task flow. It replaces the finite-state machine used in the original ROS Navigation Stack with a more flexible and maintainable tree of actions and conditions.
- Nodes represent actions (e.g., ComputePathToPose), conditions (e.g., IsGoalReached), or control flow (e.g., Sequence, Fallback).
- Reactive Execution allows the tree to be ticked at a high frequency, enabling dynamic replanning and recovery behaviors based on sensor feedback.
- This architecture cleanly separates high-level task logic from the low-level server implementations, making the system more debuggable and extensible.
Planner, Controller, & Recovery Servers
Navigation2 decomposes the navigation problem into three primary server types, each managed as a ROS 2 Lifecycle Node for controlled state transitions.
- Planner Server: Calculates a global path from the robot's current position to a goal. Plugins like Nav2 Smac Planner (using hybrid A* or State Lattice search) or Global Planner are loaded dynamically.
- Controller Server: Generares local velocity commands to follow the global path while avoiding dynamic obstacles. It uses plugins like DWB (Dynamic Window Approach) or MPC (Model Predictive Controller).
- Recovery Server: Executes a series of fallback behaviors (e.g., clear costmap, spin in place, back up) when the robot is stuck or receives invalid sensor data.
Layered Costmap System
The Costmap is a central 2D or 3D occupancy grid representation used by both the planner and controller. It is built from multiple sensor layers for robustness.
- Static Layer: Loads a pre-existing map (e.g., from SLAM) as the persistent baseline.
- Obstacle Layer: Dynamically inserts and removes obstacles from real-time sensor data (e.g., LiDAR, depth cameras).
- Inflation Layer: Expands obstacle boundaries by a user-defined radius to create a cost gradient, ensuring the robot plans paths with a safe clearance.
- This layered approach allows different sensors and map sources to be fused into a single, coherent representation of traversable space.
BT Navigator Servers
BT Navigator Servers are specialized action servers that wrap the core Planner, Controller, and Recovery servers with a behavior tree interface. They translate high-level navigation requests into the specific sequence of BT node executions.
- NavigateToPose: The primary action for autonomous navigation to a goal pose (x, y, θ). Its internal tree handles global planning, controller activation, and recovery behaviors.
- NavigateThroughPoses: An action for following a sequence of intermediate waypoints.
- ComputePathToPose: A planning-only action that returns a path without executing it, useful for previewing or hybrid planning systems.
- These servers expose the navigation system's capabilities as standard ROS 2 actions, providing feedback and cancelation support.
Lifecycle Management
All core servers in Navigation2 are implemented as ROS 2 Lifecycle Nodes. This provides a structured state machine for system initialization, error recovery, and shutdown.
- States: Unconfigured → Inactive → Active → (Error Processing) → Finalized.
- Controlled Activation: The system can be brought up in a configured but inactive state, allowing parameters to be set before any computation begins.
- System Resilience: If a critical component fails (e.g., a sensor driver crashes), the lifecycle manager can deactivate dependent nodes, attempt recovery, and reactivate them, preventing undefined behavior.
Plugin-Based Architecture
Navigation2 uses a pluginlib-based architecture for its core algorithms, allowing developers to swap or extend components without modifying the framework's core code.
- Planner Plugins: Implement the
nav2_core::GlobalPlannerinterface (e.g., SmacPlanner, Theta*). - Controller Plugins: Implement the
nav2_core::Controllerinterface (e.g., DWB, Regulated Pure Pursuit). - Recovery Behavior Plugins: Implement the
nav2_core::Recoveryinterface. - This design promotes experimentation and customization, enabling the use of specialized algorithms for different robot kinematics (differential drive, Ackermann, holonomic) or environmental constraints.
How ROS 2 Navigation2 Works
ROS 2 Navigation2 is the official, production-grade navigation framework for ROS 2, providing a modular and behavior tree-driven system for mobile robot localization, path planning, and control.
ROS 2 Navigation2 is a behavior tree-based software stack that enables a mobile robot to autonomously move from a start to a goal pose. It integrates core modules for global localization (e.g., via AMCL), global path planning (creating a coarse route), local costmap generation (for immediate obstacles), local trajectory planning (generating kinematically feasible, collision-free paths), and a controller (e.g., a Model Predictive Controller) to compute motor commands. The behavior tree orchestrates these components, managing task execution, recovery behaviors, and error handling.
The system operates on a hierarchy of costmaps—grid-based representations of the environment where cell values indicate traversability. A static global costmap is typically loaded from a pre-existing map, while a local costmap is updated in real-time by sensor data. The planner uses these maps to compute paths, and the controller tracks them. Navigation2 is highly configurable via YAML files and supports plugin-based architectures for planners, controllers, and recovery behaviors, allowing integration of custom algorithms for specific robot kinematics or environmental challenges.
Navigation2 vs. ROS 1 Navigation Stack
A technical comparison of the core architectural and functional differences between the ROS 2 Navigation2 framework and its ROS 1 predecessor, the move_base navigation stack.
| Architectural Feature / Capability | ROS 1 Navigation Stack (move_base) | ROS 2 Navigation2 |
|---|---|---|
Core Architectural Pattern | Finite State Machine (FSM) | Behavior Tree (BT) |
Primary Executor / Scheduler | Custom action server with fixed FSM logic | Flexible Behavior Tree Executor (BT.CPP) |
Modularity & Pluggability | Limited; requires modifying core state machine | High; behaviors are modular BT nodes, easily swapped |
Recovery Behavior Logic | Hardcoded sequence (e.g., clear costmaps, rotate) | Fully configurable recovery subtree with fallback logic |
Runtime Reconfiguration | Requires node restart for most planner/controller changes | Dynamic via ROS 2 parameters and live BT XML reloading |
Primary Communication Layer | ROS 1 (TCPROS/UDPROS) | ROS 2 with DDS (Data Distribution Service) |
Quality of Service (QoS) Control | Not available | Configurable per topic (e.g., RELIABLE vs. BEST_EFFORT) |
Built-in Lifecycle Management | ||
Multi-Robot Support | Complex, requires manual network segregation | Simplified via ROS 2 Domain IDs |
Security Features | None | Available via SROS 2 (DDS Security) |
Primary Build System | catkin | colcon |
Default Global Planner | navfn | Smac Planner (State Lattice, Hybrid-A*) |
Default Local Planner | Trajectory Rollout / DWA | Regulated Pure Pursuit / DWB |
Controller Server Architecture | Monolithic (part of move_base) | Modular (separate Controller Server BT) |
Progress Monitoring & Feedback | Basic (via action goal status) | Granular (via BT node status and blackboard updates) |
Frequently Asked Questions
Essential questions and answers about the ROS 2 Navigation2 framework, the standard system for autonomous mobile robot navigation.
ROS 2 Navigation2 is the official, production-grade navigation framework for ROS 2, providing a complete software stack for mobile robots to autonomously move from a start to a goal location while avoiding obstacles. It is the successor to the ROS 1 move_base package, rebuilt with a modern, behavior tree-based architecture for improved modularity, reliability, and recovery handling. The system integrates core navigation components—localization, path planning, and control—into a cohesive pipeline managed by a behavior tree that orchestrates complex navigation behaviors like recovery from failure.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The Navigation2 framework integrates several core robotic subsystems. These related terms define the components and concepts essential for autonomous mobile robot navigation.
Behavior Tree (BT)
A Behavior Tree is a hierarchical, modular control architecture used to structure the high-level decision-making logic of an autonomous agent. In Navigation2, a BT orchestrates the navigation pipeline, dynamically selecting and executing navigation behaviors (like ComputePathToPose, FollowPath, Recovery) based on task success, failure, or ongoing conditions. This replaces the older, more rigid finite-state machine approach with a more flexible and maintainable system for complex task sequencing.
Costmap 2D
A Costmap 2D is a grid-based, 2.5D representation of the environment where each cell holds an occupancy cost value. Navigation2 uses layered costmaps to fuse data from different sources:
- Static Layer: The pre-existing map (from SLAM).
- Obstacle Layer: Dynamic obstacles from sensors like LiDAR.
- Inflation Layer: Adds a gradient cost around obstacles to keep the robot at a safe distance. The planner uses this aggregated costmap to compute safe, low-cost paths.
Localization (AMCL)
Localization is the process of estimating a robot's pose (position and orientation) within a known map. Navigation2 primarily uses the Adaptive Monte Carlo Localization (AMCL) algorithm, a probabilistic particle filter. AMCL estimates the robot's pose by:
- Maintaining a set of pose hypotheses (particles).
- Weighing them against incoming sensor data (e.g., laser scans).
- Resampling to focus on the most likely areas. This provides the crucial pose estimate required for global planning and local control.
Global Planner
A Global Planner is an algorithm that computes a feasible, long-distance path from the robot's start pose to a goal pose, using the global costmap (which includes the static map). Its role is strategic, finding a topologically correct route. Navigation2 includes planners like:
- NavFn: Uses a potential field/Dijkstra algorithm.
- Smac Planners (Grid-based, State Lattice): More kinematically feasible options. The output is a coarse path for the local planner to follow.
Local Planner / Controller
A Local Planner (or Controller) is responsible for generating velocity commands (linear and angular) to follow the global path while avoiding immediate, dynamic obstacles visible in the local costmap. It operates on a shorter horizon and higher frequency than the global planner. Navigation2's default is the DWB (Dynamic Window Approach) Local Planner, which:
- Generates a sampling space of feasible velocities.
- Simulates trajectories for each.
- Scores them based on path alignment, obstacle clearance, and speed.
- Selects the optimal command to send to the robot's base.
Recovery Behaviors
Recovery Behaviors are fallback actions triggered by the Behavior Tree when the robot is stuck (e.g., the planner fails or the robot is blocked). They are designed to clear the local costmap and attempt to regain a valid state. Common recoveries in Navigation2 include:
- Clear Costmap Service: Clears obstacles from a specified costmap layer.
- Spin: Rotates in place to potentially find a new path.
- Back Up: Moves backward a short distance. These behaviors are executed in a sequence defined by the BT's recovery subtree.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us