Nav2 Documentation

repository·main·Indexed 26 days ago

https://github.com/ros-navigation/navigation2

A professional-grade navigation framework for ROS 2 providing algorithms and tools for autonomous mobile robot navigation, including planning, control, and obstacle avoidance. It supports 2D indoor, outdoor, and 3D navigation scenarios. Key components include the BT Navigator for Behavior Tree-based logic, Adaptive Monte Carlo Localization (AMCL), a Collision Monitor for safety-critical velocity filtering, and a behavior server for implementing custom robot behaviors.

Tokens
41.4K
Snippets
53
Records
215
Agent score
89%

What's inside Nav2

  1. Overview of Nav2 System Tests

    main

    The nav2_system_tests package provides high-level smoke and integration tests for the navigation system. It is designed to ensure the system works correctly at a macro level by testing Component-Testing, Subsystem-Testing, and Full-System integration.

    Most tests utilize Gazebo instances to simulate a robot in a virtual environment performing specific tasks. This package is primarily used in Nav2 CI to validate large architectural changes, but it is also useful for verifying local Nav2 installations.

  2. Overview of Nav2 Collision Monitor

    main

    The Collision Monitor is a safety node that operates independently of the Nav2 costmap and trajectory planners. It acts as a filter on the cmd_vel topic coming from the Controller Server to prevent imminent collisions by scaling or stopping the robot's velocity based on real-time sensor data.

    Key Characteristics:

    • Safety Level: Provides an emergency-stop level of protection, though it is implemented at the CPU level and does not provide hard real-time safety certifications.
    • Latency: Designed to bypass the costmap to minimize reaction latency by using fresh sensor data directly.
    • Data Sources: Supports sensor_msgs::msg::LaserScan, sensor_msgs::msg::PointCloud2, sensor_msgs::msg::Range (IR/Sonars), and nav2_msgs::msg::Costmap.
    • Behavior: When multiple safety zones are triggered simultaneously, the most aggressive behavior (e.g., stop > slow 50% > slow 10%) is applied.
  3. Overview of Nav2 Route Server

    main

    The Nav2 Route Server is a Nav2 Task server designed to complement the Planner Server's free-space planning with pre-defined Navigation Route Graph planning. It can be used to:

    1. Replace free-space planning: Use when exact route following is required (minimizing controller deviation).
    2. Augment global planning: Use long-distance routing via the graph combined with localized free-space planning for immediate surroundings (e.g., the next 10m or 100m).

    The server uses an optimized Dijkstra's algorithm and supports plugin-based scoring, custom operations during execution, and various graph file formats (e.g., geoJSON, OpenStreetMap). It can handle both node-based and pose-based planning requests.

  4. Overview of Adaptive Monte Carlo Localization (AMCL)

    main
    Adaptive Monte Carlo Localization (AMCL) is a probabilistic localization module used to estimate a robot's position and orientation (Pose) within a known map. It utilizes a 2D laser scanner for localization. This module is a refactored port from ROS 1 and maintains the same algorithmic behavior.
  5. Overview of BT Navigator

    main

    The BT Navigator (Behavior Tree Navigator) is a module that implements the NavigateToPose and NavigateThroughPoses task interfaces. It uses a Behavior Tree (BT) based approach to navigation, allowing for flexible and complex robot behaviors.

    Key features:

    • Uses an XML description of a Behavior Tree to define navigation logic.
    • Leverages the BehaviorTree.CPP library for dynamic creation and execution of trees.
    • Supports specifying the BT XML via a global Node parameter or on a per-task basis, enabling different behaviors for different navigation tasks.
  6. Overview of nav2_voxel_grid

    main
    The nav2_voxel_grid package provides a dense voxel grid representation and 3D raycasting implementations. It is primarily used by the Voxel Layer within nav2_costmap_2d, but it is available as a standalone package for any application requiring a 2D char pointer array representation of a map where bit locations correspond to voxel values (e.g., free, unknown, occupied).
  7. Overview of nav2_util package

    main

    The nav2_util package provides shared utility functions and classes abstracted from individual Nav2 packages. It is designed to reduce boilerplate and provide common robotics tools. Key features include:

    • Geometry utilities: Computing distances and values within paths.
    • Lifecycle node wrappers: Simplified Nav2-specific lifecycle node implementations including utilities like declare_parameter_if_not_declared().
    • Communication helpers: Simplified service clients and action servers.
    • Pose and Transform helpers: Tools for handling robot poses and coordinate transformations.
    • Velocity utilities: Specialized Twist Publisher and Twist Subscriber classes for managing commanded velocities.
  8. Overview of the DWB Controller

    main

    The DWB (Dynamic Window Approach with Critics) controller is a plugin-based local planner in Nav2. It is designed to be highly configurable, allowing users to specify custom behaviors through two types of plugins: Trajectory Generators and Critics.

    Key features include:

    • Plugin-based Critics: Allows for dynamic reconfiguration, reweighting, and tuning of scoring functions.
    • Plugin-based Trajectory Generation: Supports various vehicle types (e.g., omnidirectional, differential drive) by swapping generation techniques.
    • Versatility: Can be tuned to emulate ROS 1 base_local_planner or DWA behaviors.
  9. Overview of Nav2 Docking Framework

    main

    The Nav2 Docking Framework provides an automatic robot docking system and auxiliary tools. It is designed to be called by an application (such as a Behavior Tree or autonomy application) when a robot needs to dock due to low battery or task completion. It is not intended to be part of the navigate-to-pose action itself, though undock may be called from within navigation actions.

    The framework is split into four packages:

    • opennav_docking: The main docking framework.
    • opennav_docking_core: Contains the dock plugin header files required for implementing new dock types.
    • opennav_docking_bt: Contains Behavior Tree nodes and example XML files.
    • nova_carter_docking: An implementation for the Nvidia Nova Carter robot platform.
  10. Overview of Nav2 Costmap_2d

    main
    The costmap_2d package builds a 2D representation of the environment using multiple data layers. It can be initialized using a map server or as a local rolling window. The package updates these layers using sensor observations. A plugin interface allows different layers to be combined and subsequently inflated based on a robot's footprint and an inflation radius. This package is a ROS 2 port of the original ROS 1 navigation stack version.
  11. Overview of the Nav2 Planner Server

    main
    The Nav2 Planner is a Task Server within the Nav2 framework that implements the nav2_behavior_tree::ComputePathToPose interface. Its primary responsibility is to generate a feasible path between a starting robot pose and a target end pose. The server is designed to load multiple planner plugins, allowing the robot to use different path generation algorithms depending on the specific user-defined situation or environment.