Physical AI
DATED: June 23, 2026

Moving with intelligence: An introduction to Nav2 

Moving with intelligence: An introduction to Nav2 

Robotics is probably the top 3 most ambitious things ever undertaken by humanity. Space exploration is a good shout for the number one spot. But that is debatable because robotics is about imitating life. And nothing is harder than imitating life (in our opinion).  

However, to really imitate life, robots need motion that resembles animal or human behavior. But building a robot that can navigate its environment in that fashion is an entirely different ball game.  

Navigation requires a robot to perceive its surroundings, reason about the best course of action, avoid obstacles, and recover gracefully when things go wrong. 

Xavor utilizes the Nav2 (Navigation 2) framework to give our robots the intelligence they need to operate safely in complex, real-world environments. And in this blog, we’ll share our experience using it across our various robotics solutions.  

What Is Nav2? 

Nav2 is the official, industry-standard navigation software stack for ROS 2 (Robot Operating System 2). It is the modern open-source middleware that powers professional robots worldwide. Think of it as a highly advanced autopilot system purpose-built for ground robots. 

A standard GPS tells you where you are, but Nav2 tells the robot how to get there. It calculates routes while avoiding walls and people. Moreover, physical AI robots built using Nav2 can recover from unexpected blocks and do all of this in real time. 

Nav2 is not a single program. It is an ecosystem of coordinated software modules, each handling a distinct piece of the navigation problem. These modules communicate seamlessly through ROS 2, and together they give a robot everything it needs to go from point A to point B without human intervention. 

How does Nav2 work? The three questions every robot must answer 

To navigate successfully, a robot needs to continuously answer three fundamental questions: 

“Where am I?” is about localization 

There are scenes in movies where the hero gains consciousness and immediately asks where am I? Robots work pretty much like that. Before they can plan a route, robots must know their own position on the map. Nav2 accomplishes this through a process called localization.  

Using data from sensors such as LiDAR (Light Detection and Ranging) and depth cameras, the robot compares what it currently “sees” to a pre-built map of its environment. 

A common algorithm used here is AMCL (Adaptive Monte Carlo Localization), which maintains a statistical distribution of possible robot positions and continuously refines it as new sensor data arrives.  

For more demanding scenarios, tools like slam_toolbox allow the robot to build and update the map simultaneously, which is a technique known as SLAM (Simultaneous Localization and Mapping). 

“What is the best path?” leads to global planning 

Once the robot knows where it is, Nav2’s Global Planner calculates the most efficient route to the destination. This works similarly to how Google Maps finds the fastest route between two addresses. Except the “roads” are the open spaces in the robot’s map and the “obstacles” are walls, furniture, and other physical barriers. 

Common global planning algorithms include NavFn and Smac Planner, both of which can produce smooth, kinematically feasible paths suited to the robot’s size and movement constraints. 

“How do I avoid that person?” decides local control 

This question is something a lot of car drivers should also know the answer to. In robots, the global plan gives the machine a roadmap. But the real world is dynamic, where things happen randomly. People move in a moment, and new obstacles appear unexpectedly.  

The Local Controller (or Local Planner) is responsible for executing the global path in real time while continuously reacting to these changes. 

Nav2 uses controllers like DWB (Dynamic Window Approach B) or the newer MPPI (Model Predictive Path Integral) controller. These algorithms sample many possible motion trajectories every few milliseconds, evaluate each one for safety and progress, and select the best option that enables smooth, collision-free movement even in crowded spaces. 

Understanding the costmap: The robot’s awareness layer 

At the heart of Nav2’s safety system is the Costmap. A costmap is a grid-based representation of the environment that assigns a cost value to every cell, where a higher cost means the cell is more dangerous or difficult to traverse. 

Nav2 operates two costmaps simultaneously: 

  • Global Costmap: A static, big-picture map used by the global planner to find the overall route. 
  • Local Costmap: A smaller, real-time map around the robot, constantly updated with live sensor data to handle dynamic obstacles. 

A key feature of both costmaps is the Inflation Layer. This layer expands every obstacle outward by a configurable radius, creating a virtual “keep-out zone.” This ensures the robot maintains a safe buffer distance from walls, equipment, and people — even when navigating in tight corridors. 

Behavior trees: The decision-making brain 

One of Nav2’s most powerful features is its use of Behavior Trees (BTs) as the high-level decision-making engine. Unlike traditional “if-this-then-that” scripting, Behavior Trees organize complex robot behaviors into a hierarchical, modular structure. 

BTs matter enormously in practice. Consider a scenario where a robot is navigating to a destination and encounters a person standing in its path. With a simple script, the robot might just stop and wait indefinitely. With a Behavior Tree, Nav2 can: 

  • Wait for a configurable period to see if the obstacle clears. 
  • If it isn’t clear, attempt to compute an alternative path around it. 
  • If no alternative exists, back up and try again from a different angle. 
  • If all recovery behaviors fail, report the failure gracefully to the system operator. 

Graceful failure handling is critical in professional environments. Robots need to be predictable and safe even when things go wrong, and Behavior Trees give Nav2 the flexibility to handle an enormous variety of real-world scenarios without hard-coding every possible edge case. 

Modular design: Built for every robot 

Nav2 is built around a plugin-based architecture. Every core component — the planner, controller, costmap layer, and recovery behavior — is a plugin that can be swapped out depending on the application. 

This means that the same Nav2 framework can power robots with very different requirements: 

  • A small indoor delivery robot might use a lightweight DWB controller and a simple 2D LiDAR for rapid, energy-efficient navigation. 
  • A large hospital service robot might combine an RGB-D camera, a more sophisticated MPPI controller, and additional costmap layers for human-aware navigation. 
  • An outdoor last-mile delivery platform might add GPS fusion and terrain-aware planning plugins. 

At Xavor, we take advantage of this modularity to configure Nav2 precisely for each deployment environment, rather than building a one-size-fits-all solution that compromises performance across use cases. 

Why Xavor chooses Nav2 

With dozens of navigation frameworks available, the choice of Nav2 is deliberate. Here is why it stands out: 

  • Production-Ready Reliability: Nav2 is actively maintained by Open Robotics and a large open-source community. It has been tested and deployed in real-world commercial robots across industries. 
  • ROS 2 Native: Built specifically for ROS 2, Nav2 benefits from ROS 2’s modern real-time capabilities, security features, and multi-robot support. These capabilities were not offered in the older ROS 1 navigation stack. 
  • Hardware Agnostic: Nav2 runs on any robot hardware, which makes it an ideal long-term investment as hardware scales. 
  • Reduced Development Time: By leveraging a battle-tested framework, our engineering teams spend less time reinventing navigation fundamentals and more time solving the unique challenges of each customer’s deployment environment. 
  • Safety by Design: With built-in recovery behaviors, inflation layers, and real-time obstacle avoidance, Nav2 treats safety as a first-class concern. 

Real-world impact: Where we use Nav2 

Nav2 is not a research prototype. It is the backbone of real deployments. At Xavor, we use it to power our indoor service robots in scenarios that demand both reliability and human-safe operation: 

  • Care and Assisted Living Facilities: Robots that navigate autonomously through corridors, avoid residents and staff, and deliver supplies or companionship without requiring dedicated infrastructure changes. 
  • Healthcare Environments: Precise, predictable navigation in clinics and hospitals where unexpected behaviour of robots in healthcare is not acceptable. 
  • Industrial and Warehouse Floors: Autonomous transport of materials with real-time dynamic obstacle avoidance around forklifts and workers. 

In each of these domains, the combination of Nav2’s localization accuracy, planning efficiency, and real-time safety responses translates directly into robots that operators and end-users can trust. 

Conclusion 

Navigation for robotics is not a solved problem. Environments change, new sensors emerge, and user expectations grow. Nav2’s open, modular architecture means it continues to evolve with new planners, controllers, and perception integrations being contributed by the global ROS 2 community. 

Xavor remains deeply invested in this ecosystem. Our engineering team continuously evaluates new Nav2 capabilities to ensure our robots stay at the forefront of autonomous navigation. 

If you are curious about how autonomous navigation could transform your operations, contact us at [email protected] to discuss what robotics can do for you. 

About the Author
Technical Lead – Robotics & Embedded
Ali is the Technical Lead for Robotics and Embedded Systems at Xavor, specializing in UAVs and ROS-based robot development. He manages the entire product lifecycle—from initial prototyping to field-ready deployment—delivering sophisticated autonomous solutions across both industrial and defense domains.

FAQs

Nav2 (Navigation 2) is a robotics framework used to help autonomous robots navigate safely and efficiently in real-world environments. It enables robots to determine their location, plan routes, avoid obstacles, adapt to changing surroundings, and reach destinations without human intervention. 

Not exactly. Nav2 is a navigation framework and software stack for ROS 2 that consists of multiple packages working together. These packages handle tasks such as localization, path planning, obstacle avoidance, behavior management, and recovery actions, enabling robots to navigate autonomously in complex environments. 

Yes. Nav2 is an open-source navigation framework for ROS 2 (Robot Operating System 2) that is actively maintained by the robotics community and supported by Open Robotics contributors. Its open-source nature allows developers to customize, extend, and deploy it across a wide range of robotic platforms and applications. 

Scroll to Top