Nav2 Documentation

repository·rolling·Indexed 41 days ago

https://github.com/ros-navigation/docs.nav2.org

Documentation for the Nav2 navigation framework, including guides on Behavior Tree (BT) node configuration, XML examples, and installation via Docker or Python virtual environments. Includes instructions for managing versioned distributions using MkDocs and mike.

Tokens
255.2K
Snippets
452
Records
1.1K
Agent score
52%

What's inside Nav2

  1. Overview of the First-Time Robot Setup Guide

    rolling

    The First-Time Robot Setup Guide provides a structured sequence of tutorials to help users set up Nav2 with a new or custom-built robot. It serves as a checklist and boilerplate reference for configuring the essential components required for navigation.

    Key Objectives:

    • Assist in setting up Nav2 with new or custom robots.
    • Provide simulation-ready examples (Gazebo/RViz) for users without physical hardware.
    • Offer guidance on integrating sensors, odometry, and TF2 transforms.

    Compatibility Note: This guide is specifically designed for setups using the modern Gazebo simulator (Gazebo Harmonic or newer) used with ROS 2 Jazzy or newer.

  2. Overview of Nav2 Map Server components

    rolling

    The Nav2 Map Server package provides several components for managing grid maps and geometric map data. Depending on your needs, you can use different servers to load static maps, save maps generated from SLAM, or serve spatial metadata and geometric objects.

    Supported components include:

    • Map Server: Loads and serves static occupancy grid maps.
    • Map Saver: Saves maps from SLAM to disk.
    • Costmap Filter Info Server: Publishes spatial filter metadata used for defining keepout zones or speed zones.
    • Vector Object Server: Serves dynamic geometric map objects such as polygons, lines, and points.
  3. Overview of Navigation Plugin Interfaces

    rolling

    Nav2 provides several plugin interfaces that allow developers to extend the navigation stack with custom algorithms or applications. The primary interfaces available for implementation include:

    • Costmap Layers: For adding different types of environmental data to the costmap.
    • Costmap Filters: For applying constraints or logic based on costmap masks.
    • Controllers: For local path following and obstacle avoidance.
    • Planners: For global path planning.
    • Behavior Trees: For high-level task orchestration.
    • Behavior Plugins: For custom nodes within a behavior tree.
    • Navigators: For managing navigation tasks via action servers.

    For detailed instructions on implementing these, refer to the specific 'Writing a New...' tutorials in the documentation.

  4. Overview of Navigating with SAM3 Semantic Segmentation

    rolling

    This tutorial demonstrates how to implement a live, text-promptable semantic segmentation costmap for Nav2 on edge hardware (specifically AMD Strix Halo).

    Key Components:

    • SAM3 Inference Node: Runs Meta's SAM3 foundation model on the GPU, publishing high-resolution per-pixel class masks at 5-10 Hz.
    • semantic_segmentation_layer: A Nav2 costmap plugin that consumes SAM3 masks to set costs based on terrain or obstacle types.
    • Text-Prompting: Unlike traditional models with fixed classes, SAM3 is promptable via strings (e.g., "person", "mud", "curb"). You can change the target classes at runtime using the ~/change_prompt service.

    Use Cases:

    • Terrain-aware navigation: Preferring sidewalks over grass or avoiding puddles.
    • Small obstacle detection: Identifying cables, debris, or low-profile objects that depth sensors might miss.
    • Situational awareness: Adjusting behavior based on whether the robot is in a confined or open space.
  5. Nav2 Migration Guides Overview

    rolling

    Nav2 provides specific migration guides for transitioning between different ROS 2 distributions. These guides detail changes in packages, API refinements, new features, and architectural shifts (such as LifecycleNode refactoring) that may impact your existing navigation stacks.

    Available migration paths include:

    • Dashing to Eloquent: New packages and early API refinements.
    • Eloquent to Foxy: Reduced terminal noise and TF2 improvements.
    • Foxy to Galactic: Action feedback updates and the NavigateThroughPoses action.
    • Galactic to Humble: Smac Planner improvements and the introduction of Collision Monitor.
    • Humble to Iron: New BT Navigator plugins and Graceful Controller.
    • Iron to Jazzy: BehaviorTree.CPP v4.5 upgrade and the addition of Docking Server.
    • Jazzy to Kilted: Addition of Route Server, Following Server, and Vector Object Server.
    • Kilted to Lyrical: Introduction of nav2_ros_common package and LifecycleNode refactoring.
    • Lyrical to M-Turtle: (Coming soon)
  6. Core concepts of Nav2 navigation

    rolling

    To work with Nav2, you must understand several foundational pillars of mobile robot navigation:

    • ROS 2: The underlying middleware used for all communication and lifecycle management within the Nav2 ecosystem.
    • Behavior Trees: The orchestration mechanism used to coordinate complex tasks like planning, control, and recovery behaviors.
    • Navigation Servers: The modular architecture where specific tasks are handled by dedicated servers (e.g., planners, controllers, and behaviors).
    • State Estimation: The process of tracking the robot's pose through localization, odometry, and sensor fusion.
    • Environmental Representation: How the robot perceives its surroundings using costmaps, map servers, and other spatial data structures.
  7. Summary of Navigating with GPS Localization

    rolling

    This tutorial covers the integration of GPS sensors for global localization within the Nav2 stack. Key components include:

    • Global Localization: Using a GPS sensor in conjunction with the navsat_transform node to provide global positioning.
    • Simulation Setup: Using Gazebo with a GPS-equipped robot.
    • Nav2 Configuration: Adjusting Nav2 parameters to support GPS-based localization, specifically focusing on different configurations for the global costmap.
    • Waypoint Following: Utilizing the Nav2 GPS waypoint follower to demonstrate autonomous navigation in outdoor environments.

    Note that GPS serves as a means for providing global localization; standard Nav2 Cartesian tools remain available for building custom autonomy applications beyond simple GPS waypoint following.

  8. Explore related Navigation2 projects

    rolling

    The Navigation2 ecosystem consists of several community-maintained repositories that provide core functionality, tutorials, and specialized capabilities. Use these projects to extend your ROS 2 navigation stack:

    • Navigation2: The main ROS 2 Navigation Stack.
    • navigation2_tutorials: Source code and examples used in the official documentation tutorials.
    • navigation2_dynamic: Tools and algorithms for handling dynamic obstacles.
    • navigation2.ai: AI and spatial intelligence capabilities.
    • slam_toolbox: The default 2D SLAM library.
    • robot_localization: State estimation for odometry fusion and GPS transformations.
    • BehaviorTree.CPP: The library used by Nav2 for task orchestration.
    • Fuse: A sensor fusion framework for state estimation.
    • docs.nav2.org: The source code for the official documentation website.
  9. Explore Nav2 General Tutorials

    rolling

    Nav2 provides a wide range of tutorials covering hardware deployment, advanced perception, behavior tree customization, and debugging. Key tutorial categories include:

    Hardware & Deployment

    • Navigating with a Physical Turtlebot 3: Deploying Nav2 on real Turtlebot3 hardware.
    • Docker for Development: A complete Docker workflow for Nav2 development.
    • Camera Calibration: Calibrating cameras for accurate depth and pose estimation.

    Advanced Navigation & Perception

    • Navigating while Mapping (SLAM): Simultaneous navigation and map building.
    • Using an External Costmap Plugin (STVL): Integrating Spatio-Temporal Voxel Layer for 3D perception.
    • Lidar-Free, Vision-Based Navigation: Using Nvidia Isaac ROS for camera-only navigation.
    • Navigating with Semantic Segmentation: Using AI-based segmentation (Nvidia Jetson or SAM3/AMD Strix Halo).
    • Navigating using GPS Localization: Outdoor navigation with GPS waypoints.
    • Dynamic Object Following: Tracking and following moving objects.
    • Navigating with Vector Objects: Using dynamic geometric objects in costmaps.
    • Ground Terrain Segmentation: Classifying traversable terrain from 3D pointclouds.
    • AI Depth Estimation: Using ML-based monocular depth for costmap obstacle detection.

    Behavior & Control Customization

    • Groot Tutorials: Visualizing and editing behavior trees with Groot.
    • Adding a New Nav2 Task Server: Building custom task servers for application-specific behaviors.
    • Adding a Smoother to a BT: Integrating path smoothing into behavior trees.
    • Using Rotation Shim Controller: Implementing rotate-in-place before path following.
    • Using Docking Server: Autonomous charging and static infrastructure docking.

    Environment Constraints & Safety

    • Navigating with Keepout Zones: Restricting robot access to designated areas.
    • Navigating with Speed Limits: Enforcing variable speed limits across the environment.
    • Navigating with Zone Parameter Overrides: Setting ROS parameters based on marked map zones.
    • Using Collision Monitor: Configuring real-time collision monitoring.
    • Enhanced Safety with 3Laws Supervisor: Integrating third-party safety supervisors.

    Debugging & Performance

    • Get Backtrace in ROS 2 / Nav2: Debugging crashes with GDB backtraces.
    • Profiling in ROS 2 / Nav2: Profiling CPU and memory performance.
    • Filtering of Noise-Induced Obstacles: Removing false positive obstacles from noisy sensors.
  10. Use the VDA LIF Editor for route graph generation

    rolling

    The VDA LIF Editor is a web-based, open-source tool used to create route graphs for Nav2. It allows you to present floor plans in a standardized VDA format and simultaneously generates both GeoJSON and LIF formats. This tool is useful for defining the nodes and edges that a robot will follow.

  11. What is the Vector Object Server and how does it work?

    rolling

    The Vector Object Server is a service that rasterizes vector shapes (polygons and circles) onto an OccupancyGrid map. This output map can be used as input masks for [Costmap Filters] or other parts of the Nav2 stack.

    Key Concepts

    • Performance: Instead of rasterizing shapes at runtime every iteration, the server performs the rasterization once (at startup or when shapes change) and serves the resulting map, which improves performance.
    • Dynamic vs. Static Updates:
      • Static: If all shapes are set in the same frame as the map, the map is updated only at startup or when AddShapes.srv or RemoveShapes.srv are called.
      • Dynamic: If at least one shape is set in a different frame than the map, a dynamic update model is enabled. The server will publish the map at a specified update_frequency to account for moving shapes.
    • Shape Identification: Each shape is identified by a unique_identifier_msgs/UUID. You can provide a manual UUID or let the server generate one automatically.
    • Overlapping Rules: When shapes overlap, the server uses a global overlay_type to determine the resulting value.