Nav2 Logo
latest
  • Getting Started
    • Installation
    • Running the Example
    • Navigating
  • Development Guides
    • Build and Install
      • Install
        • For Iron and Older
        • For Jazzy and Newer
      • Build
        • Released Distribution Binaries
        • Rolling Development Source
        • Docker Container Images
      • Generate Doxygen
      • Help
        • Build Troubleshooting Guide
    • Dev Containers
      • Dev Container Guide
        • Creating Dev Containers
        • Using Dev Containers
      • What, Why, How?
        • What is a Dev Container?
        • Why use a Dev Container?
        • How do Dev Containers work?
      • Prerequisites
      • Getting started
      • Security
    • Getting Involved
      • Getting Involved
      • Process
      • Licensing
      • Developer Certification of Origin (DCO)
  • Navigation Concepts
    • ROS 2
      • Action Server
      • Lifecycle Nodes and Bond
    • Behavior Trees
    • Navigation Servers
      • Planner, Controller, Smoother, Route, and Behavior Servers
      • Planners
      • Controllers
      • Behaviors
      • Smoothers
      • Route
      • Robot Footprints
      • Waypoint Following
    • State Estimation
      • Standards
      • Global Positioning: Localization and SLAM
      • Odometry
    • Environmental Representation
      • Costmaps and Layers
      • Costmap Filters
      • Other Forms
    • Nav2 Academic Overview
  • First-Time Robot Setup Guide
    • Table of Contents
      • Setting Up Transformations
        • Transforms Introduction
        • Static Transform Publisher Demo
        • Transforms in Navigation2
        • Conclusion
      • Setting Up The URDF
        • URDF and the Robot State Publisher
        • Setting Up the Environment
        • Writing the URDF
        • Build and Launch
        • Visualization using RVIZ
        • Adding Physical Properties
        • Conclusion
      • Setting Up The SDF - Gazebo
        • About SDF
        • Writing the SDF
        • Build and Launch
        • Conclusion
      • Setting Up Odometry - Gazebo
        • Odometry Introduction
        • Setting Up Odometry on your Robot
        • Simulating an Odometry System using Gazebo
        • Conclusion
      • Smoothing Odometry using Robot Localization
        • Configuring Robot Localization
        • Launch and Build Files
        • Build, Run and Verification
      • Setting Up Sensors - Gazebo
        • Sensor Introduction
        • Simulating Sensors using Gazebo
        • Conclusion
      • Mapping and Localization
        • Costmap 2D
        • Conclusion
      • Setting Up the Robot’s Footprint
        • Footprint Introduction
        • Configuring the Robot’s Footprint
        • Build, Run and Verification
        • Visualizing Footprint in RViz
        • Conclusion
      • Setting Up Navigation Plugins
        • Planner and Controller Servers
        • Selecting the Algorithm Plugins
        • Conclusion
      • Setting Up Transformations
        • Transforms Introduction
        • Static Transform Publisher Demo
        • Transforms in Navigation2
        • Conclusion
      • Setting Up The URDF
        • URDF and the Robot State Publisher
        • Setting Up the Environment
        • Writing the URDF
        • Build and Launch
        • Visualization using RVIZ
        • Adding Physical Properties
        • Conclusion
      • Setting Up Odometry - Gazebo Classic
        • Odometry Introduction
        • Setting Up Odometry on your Robot
        • Simulating an Odometry System using Gazebo
        • Conclusion
      • Smoothing Odometry using Robot Localization
        • Configuring Robot Localization
        • Launch and Build Files
        • Build, Run and Verification
      • Setting Up Sensors - Gazebo Classic
        • Sensor Introduction
        • Simulating Sensors using Gazebo Classic
        • Conclusion
      • Mapping and Localization
        • Costmap 2D
        • Conclusion
      • Setting Up the Robot’s Footprint
        • Footprint Introduction
        • Configuring the Robot’s Footprint
        • Build, Run and Verification
        • Visualizing Footprint in RViz
        • Conclusion
      • Setting Up Navigation Plugins
        • Planner and Controller Servers
        • Selecting the Algorithm Plugins
        • Conclusion
  • Robots Using
    • Research Robots
  • ROSCon Talks
    • Nav2 Developer Talks
    • Community’s Talks
  • General Tutorials
    • Navigating with a Physical Turtlebot 3
      • Overview
      • Requirements
      • Tutorial Steps
        • 0- Setup Your Environment Variables
        • 1- Launch Turtlebot 3
        • 2- Launch Nav2
        • 3- Launch RVIZ
        • 4- Initialize the Location of Turtlebot 3
        • 5- Send a Goal Pose
    • (SLAM) Navigating While Mapping
      • Overview
      • Requirements
      • Tutorial Steps
        • 0- Launch Robot Interfaces
        • 1- Launch Navigation2
        • 2- Launch SLAM
        • 3- Working with SLAM
        • 4- Getting Started Simplification
    • (STVL) Using an External Costmap Plugin
      • Overview
      • Costmap2D and STVL
      • Tutorial Steps
        • 0- Setup
        • 1- Install STVL
        • 1- Modify Navigation2 Parameter
        • 2- Launch Navigation2
        • 3- RVIZ
    • Navigating Using GPS Localization
      • Overview
      • Requirements
      • GPS Localization Overview
      • Tutorial Steps
        • 0- Setup Gazebo World
        • 1- Setup GPS Localization system
        • 2- Setup Navigation system
        • 3- Interactive GPS Waypoint Follower
        • 4- Logged GPS Waypoint Follower & Waypoint Logging
      • Conclusion
    • Groot Tutorials
      • Overview
      • Table of Contents
        • Groot - Interacting with Behavior Trees
        • Groot2 - Interacting with Behavior Trees
    • Using VIO to Augment Robot Odometry
      • Overview
      • Setting Up the ZED X Camera
      • Setting Up ZED ROS
      • Fusing VIO Into Local State Estimate
        • Fusing VSLAM Into Global State Estimate
      • Testing it Out!
    • Dynamic Object Following
      • Overview
      • Tutorial Steps
        • 0- Create the Behavior Tree
        • 1- Setup Rviz clicked point
        • 2- Run Dynamic Object Following in Nav2 Simulation
    • Navigating with Keepout Zones
      • Overview
      • Requirements
      • Tutorial Steps
        • 1. Prepare filter mask
        • 2. Configure Costmap Filter Info Publisher Server
        • 3. Enable Keepout Filter
        • 4. Run Nav2 stack
    • Navigating with Speed Limits
      • Overview
      • Requirements
      • Tutorial Steps
        • 1. Prepare filter mask
        • 2. Configure Costmap Filter Info Publisher Server
        • 3. Enable Speed Filter
        • 4. Run Nav2 stack
    • Using Docking Server
      • Overview
      • Requirements
      • ChargingDock Plugins
      • Dock Database
      • Configuring Docking Server
      • Adding Docking Server to Launch
      • Docking Action API
      • Putting It All Together
    • Using Rotation Shim Controller
      • Overview
      • What is the Rotation Shim Controller?
      • Configuring Rotation Shim Controller
      • Configuring Primary Controller
      • Demo Execution
    • Adding a Smoother to a BT
      • Overview
      • Requirements
      • Tutorial Steps
        • 0- Familiarization with the Smoother BT Node
        • 1- Specifying a Smoother Plugin
        • 2- Modifying your BT XML
    • Using Collision Monitor
      • Overview
      • Requirements
      • Configuring Collision Monitor
      • Configuring Collision Monitor with VelocityPolygon
      • Preparing Nav2 stack
      • Demo Execution
    • Adding a New Nav2 Task Server
      • Lifecycle Nodes
      • Composition
      • Error codes
      • Conclusion
    • Filtering of Noise-Induced Obstacles
      • Overview
      • Requirements
      • Tutorial Steps
        • 1. Enable Denoise Layer
        • 2. Run Nav2 stack
      • How it works
    • Camera Calibration
      • Overview
      • Requirements
      • Tutorial Steps
    • Get Backtrace in ROS 2 / Nav2
      • Overview
      • Preliminaries
      • From a Node
      • From a Launch File
      • From Large Project
      • From Nav2 Bringup
      • Automatic backtrace on crash
    • Profiling in ROS 2 / Nav2
      • Overview
      • Preliminaries
      • Profile from a Node
      • Profile from a Launch File
      • From Nav2 Bringup
      • Interpreting Results
    • Docker for Development: Zero to Hero
      • Overview
      • Preliminaries
      • Important Docker Commands
      • Exploring Your First Container
      • Understanding ROS Docker Images
      • For Docker-Based Development
        • Building a Development Image
        • Visualizations from Docker
      • For Docker-Based Deployment
      • Conclusion
      • Appendix
        • Nav2 Development Image
        • Nav2 Deployment Image
    • Route Server Tools
      • Provided Tools
        • Using the Nav2 Route Tool
        • Route Graph Generation LIF Editor
        • Route Graph Generation
      • Description
  • Plugin Tutorials
    • Writing a New Costmap2D Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Write a new Costmap2D plugin
        • 2- Export and make GradientLayer plugin
        • 3- Enable the plugin in Costmap2D
        • 4- Run GradientLayer plugin
    • Writing a New Planner Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Creating a new Planner Plugin
        • 2- Exporting the planner plugin
        • 3- Pass the plugin name through params file
        • 4- Run StraightLine plugin
    • Writing a New Controller Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Create a new Controller Plugin
        • 2- Exporting the controller plugin
        • 3- Pass the plugin name through the params file
        • 4- Run Pure Pursuit Controller plugin
    • Writing a New Behavior Tree Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Creating a new BT Plugin
        • 2- Exporting the planner plugin
        • 3- Add plugin library name to config
        • 4- Run Your Custom plugin
      • Using custom types for Input/Output ports
      • Visualize the content of the blackboard in Groot 2 (PRO)
    • Writing a New Behavior Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Creating a new Behavior Plugin
        • 2- Exporting the Behavior Plugin
        • 3- Pass the plugin name through params file
        • 4- Run Behavior Plugin
    • Writing a New Navigator Plugin
      • Overview
      • Requirements
      • Tutorial Steps
        • 1- Create a new Navigator Plugin
        • 2- Exporting the navigator plugin
        • 3- Pass the plugin name through the params file
        • 4- Run plugin
  • Configuration Guide
    • Behavior-Tree Navigator
      • Parameters
      • NavigateToPose Parameters
      • NavigateThroughPoses Parameters
      • Example
    • Behavior Tree XML Nodes
      • Action Plugins
        • Wait
        • Spin
        • BackUp
        • DriveOnHeading
        • AssistedTeleop
        • ComputePathToPose
        • ComputeRoute
        • ComputeAndTrackRoute
        • FollowPath
        • NavigateToPose
        • ClearEntireCostmap
        • ClearCostmapExceptRegion
        • ClearCostmapAroundRobot
        • ReinitializeGlobalLocalization
        • TruncatePath
        • TruncatePathLocal
        • PlannerSelector
        • ControllerSelector
        • SmootherSelector
        • GoalCheckerSelector
        • ProgressCheckerSelector
        • NavigateThroughPoses
        • ComputePathThroughPoses
        • ComputeCoveragePath
        • CancelCoverage
        • RemovePassedGoals
        • RemoveInCollisionGoals
        • CancelControl
        • CancelBackUp
        • CancelSpin
        • CancelWait
        • CancelDriveOnHeading
        • CancelAssistedTeleop
        • CancelComputeAndTrackRoute
        • SmoothPath
        • GetPoseFromPath
        • DockRobot
        • UndockRobot
        • ConcatenatePaths
        • GetCurrentPose
        • AppendGoalPoseToGoals
        • ExtractRouteNodesAsGoals
        • GetNextFewGoals
      • Condition Plugins
        • GoalReached
        • TransformAvailable
        • DistanceTraveled
        • GoalUpdated
        • GlobalUpdatedGoal
        • InitialPoseReceived
        • IsStuck
        • IsStopped
        • TimeExpired
        • IsBatteryLow
        • IsPathValid
        • PathExpiringTimer
        • AreErrorCodesPresent
        • WouldAControllerRecoveryHelp
        • WouldAPlannerRecoveryHelp
        • WouldASmootherRecoveryHelp
        • WouldARouteRecoveryHelp
        • IsBatteryCharging
        • ArePosesNear
      • Control Plugins
        • PipelineSequence
        • RoundRobin
        • RecoveryNode
      • Decorator Plugins
        • RateController
        • DistanceController
        • SpeedController
        • GoalUpdater
        • PathLongerOnApproach
        • SingleTrigger
        • GoalUpdatedController
      • Example
    • Costmap 2D
      • Costmap2D ROS Parameters
      • Default Plugins
      • Plugin Parameters
        • Static Layer Parameters
        • Inflation Layer Parameters
        • Obstacle Layer Parameters
        • Voxel Layer Parameters
        • Range Sensor Parameters
        • Denoise Layer Parameters
        • Plugin Container Layer Parameters
      • Costmap Filters Parameters
        • Keepout Filter Parameters
        • Speed Filter Parameters
        • Binary Filter Parameters
      • Example
    • Lifecycle Manager
      • Parameters
      • Example
    • Planner Server
      • Parameters
      • Default Plugins
      • Example
    • Coverage Server
      • Parameters
      • Example
    • NavFn Planner
      • Parameters
      • Example
    • Smac Planner
      • Provided Plugins
        • Smac 2D Planner
        • Smac Hybrid-A* Planner
        • Smac State Lattice Planner
      • Description
    • Theta Star Planner
      • Parameters
      • Example
    • Controller Server
      • Parameters
      • Provided Plugins
        • SimpleProgressChecker
        • PoseProgressChecker
        • SimpleGoalChecker
        • StoppedGoalChecker
      • Default Plugins
      • Example
    • DWB Controller
      • Controller
        • DWB Controller
        • XYTheta Iterator
        • Kinematic Parameters
        • Publisher
      • Plugins
        • LimitedAccelGenerator
        • StandardTrajectoryGenerator
      • Trajectory Critics
        • BaseObstacleCritic
        • GoalAlignCritic
        • GoalDistCritic
        • ObstacleFootprintCritic
        • OscillationCritic
        • PathAlignCritic
        • PathDistCritic
        • PreferForwardCritic
        • RotateToGoalCritic
        • TwirlingCritic
      • Example
    • Regulated Pure Pursuit
      • Regulated Pure Pursuit Parameters
      • Example
    • Model Predictive Path Integral Controller
      • MPPI Parameters
        • Trajectory Visualization
        • Path Handler
        • Ackermann Motion Model
        • Constraint Critic
        • Goal Angle Critic
        • Goal Critic
        • Obstacles Critic
        • Cost Critic
        • Path Align Critic
        • Path Angle Critic
        • Path Follow Critic
        • Prefer Forward Critic
        • Twirling Critic
        • Velocity Deadband Critic
      • Example
      • Notes to Users
        • General Words of Wisdom
        • Prediction Horizon, Costmap Sizing, and Offsets
        • Obstacle, Inflation Layer, and Path Following
    • Rotation Shim Controller
      • Rotation Shim Controller Parameters
      • Example
    • Graceful Controller
      • Graceful Controller Parameters
      • Example
    • Map Server / Saver
      • Map Saver Parameters
      • Map Server Parameters
      • Costmap Filter Info Server Parameters
      • Example
    • AMCL
      • Parameters
      • Example
    • Behavior Server
      • Behavior Server Parameters
      • Default Plugins
      • Spin Behavior Parameters
      • BackUp Behavior Parameters
      • DriveOnHeading Behavior Parameters
      • AssistedTeleop Behavior Parameters
      • Example
    • Smoother Server
      • Smoother Server Parameters
      • Example
    • Simple Smoother
      • Simple Smoother Parameters
      • Example
    • Savitzky-Golay Smoother
      • Savitzky-Golay Smoother Parameters
      • Example
    • Constrained smoother
      • Smoother Server Parameters
      • Example
    • Velocity Smoother
      • Velocity Smoother Parameters
      • Example
    • Collision Monitor
      • Provided Nodes
        • Collision Monitor Node
        • Collision Detector Node
    • Waypoint Follower
      • Parameters
      • Provided Plugins
        • WaitAtWaypoint
        • PhotoAtWaypoint
        • InputAtWaypoint
      • Default Plugin
      • Example
    • Loopback Simulator
      • Parameters
      • Example
    • Docking Server
      • Parameters
      • SimpleChargingDock Parameters
      • Example
    • Route Server
      • Server Parameters
      • Edge Scorer Parameters
        • CostmapScorer
        • DistanceScorer
        • TimeScorer
        • PenaltyScorer
        • SemanticScorer
        • StartPoseOrientationScorer
        • GoalPoseOrientationScorer
        • DynamicEdgesScorer
      • Route Operations Parameters
        • AdjustSpeedLimit
        • CollisionMonitor
        • TimeMarker
        • ReroutingService
        • TriggerEvent
      • Example
  • Tuning Guide
    • Inflation Potential Fields
    • Robot Footprint vs Radius
    • Rotate in Place Behavior
    • Planner Plugin Selection
    • Controller Plugin Selection
    • Caching Obstacle Heuristic in Smac Planners
    • Costmap2D Plugins
    • Nav2 Launch Options
    • Other Pages We’d Love To Offer
  • Nav2 Behavior Trees
    • Introduction To Nav2 Specific Nodes
      • Action Nodes
      • Condition Nodes
      • Decorator Nodes
      • Control: PipelineSequence
      • Control: Recovery
      • Control: RoundRobin
    • Detailed Behavior Tree Walkthrough
      • Overview
      • Prerequisites
      • Navigate To Pose With Replanning and Recovery
      • Navigation Subtree
      • Recovery Subtree
    • Navigate To Pose
    • Navigate Through Poses
    • Navigate To Pose and Pause Near Goal-Obstacle
    • Navigate To Pose With Consistent Replanning And If Path Becomes Invalid
    • Navigate on Route Graph with Recovery
    • Follow Dynamic Point
    • Odometry Calibration
  • Navigation Plugins
    • Behavior-Tree Navigators
    • Costmap Layers
    • Costmap Filters
    • Controllers
    • Planners
    • Smoothers
    • Behaviors
    • Waypoint Task Executors
    • Goal Checkers
    • Progress Checkers
    • Behavior Tree Nodes
    • Route Plugins
      • Edge Scorers
      • Route Operations
      • Graph File Parsers
  • Migration Guides
    • Dashing to Eloquent
      • New Packages
      • New Plugins
      • Navigation2 Architectural Changes
    • Eloquent to Foxy
      • General
      • Server Updates
      • New Plugins
      • Map Server Re-Work
      • New Particle Filter Messages
      • Selection of Behavior Tree in each navigation action
      • FollowPoint Capability
      • New Costmap Layer
    • Foxy to Galactic
      • NavigateToPose Action Feedback updates
      • NavigateToPose BT-node Interface Changes
      • NavigateThroughPoses and ComputePathThroughPoses Actions Added
      • ComputePathToPose BT-node Interface Changes
      • ComputePathToPose Action Interface Changes
      • BackUp BT-node Interface Changes
      • BackUp Recovery Interface Changes
      • Nav2 Controllers and Goal Checker Plugin Interface Changes
      • FollowPath goal_checker_id attribute
      • Groot Support
      • New Plugins
      • Costmap Filters
      • SmacPlanner
      • ThetaStarPlanner
      • RegulatedPurePursuitController
      • Costmap2D current_ Usage
      • Standard time units in parameters
      • Ray Tracing Parameters
      • Obstacle Marking Parameters
      • Recovery Action Changes
      • Default Behavior Tree Changes
      • NavFn Planner Parameters
      • New ClearCostmapExceptRegion and ClearCostmapAroundRobot BT-nodes
      • New Behavior Tree Nodes
      • sensor_msgs/PointCloud to sensor_msgs/PointCloud2 Change
      • ControllerServer New Parameter failure_tolerance
      • Removed BT XML Launch Configurations
      • Nav2 RViz Panel Action Feedback Information
    • Galactic to Humble
      • Major improvements to Smac Planners
      • Simple (Python) Commander
      • Reduce Nodes and Executors
      • API Change for nav2_core
      • Extending the BtServiceNode to process Service-Results
      • Including new Rotation Shim Controller Plugin
      • Spawning the robot in Gazebo
      • Recovery Behavior Timeout
      • New parameter use_final_approach_orientation for the 3 2D planners
      • SmacPlanner2D and Theta*: fix goal orientation being ignored
      • SmacPlanner2D, NavFn and Theta*: fix small path corner cases
      • Change and fix behavior of dynamic parameter change detection
      • Dynamic Parameters
      • BT Action Nodes Exception Changes
      • BT Navigator Groot Multiple Navigators
      • Removed Kinematic Limiting in RPP
      • Added Smoother Task Server
      • Removed Use Approach Velocity Scaling Param in RPP
      • Refactored AMCL motion models as plugins
      • Dropping Support for Live Groot Monitoring of Nav2
      • Replanning Only if Path is Invalid
      • Fix CostmapLayer clearArea invert param logic
      • Dynamic Composition
      • BT Cancel Node
      • BT PathLongerOnApproach Node
      • BT TruncatePathLocal Node
      • Constrained Smoother
      • Replanning at a Constant Rate and if the Path is Invalid
      • Euclidean Distance 2D
      • Recovery To Behavior
      • Respawn Support in Launch and Lifecycle Manager
      • New Nav2 Velocity Smoother
      • Goal Checker API Changed
      • Added Assisted Teleop
    • Humble to Iron
      • New Behavior-Tree Navigator Plugins
      • Added Collision Monitor
      • Removed use_sim_time from yaml
      • Run-time Speed up of Smac Planner
      • Recursive Refinement of Smac and Simple Smoothers
      • Simple Commander Python API
      • Smac Planner Start Pose Included in Path
      • Parameterizable Collision Checking in RPP
      • Expanded Planner Benchmark Tests
      • Smac Planner Path Tolerances
      • costmap_2d_node default constructor
      • Feedback for Navigation Failures
      • Costmap Filters
      • Savitzky-Golay Smoother
      • Changes to Map yaml file path for map_server node in Launch
      • SmootherSelector BT Node
      • Publish Costmap Layers
      • Give Behavior Server Access to Both Costmaps
      • New Model Predictive Path Integral Controller
      • Behavior Tree Uses Error Codes
      • Load, Save and Loop Waypoints from the Nav2 Panel in RViz
      • DWB Forward vs Reverse Pruning
      • More stable regulation on curves for long lookahead distances
      • Publish Collision Monitor State
      • Renamed ROS-parameter in Collision Monitor
      • New safety behavior model “limit” in Collision Monitor
      • Velocity smoother applies deceleration when timeout
      • PoseProgressChecker plugin
      • Allow multiple goal checkers and change parameter progress_checker_plugin(s) name and type
      • IsBatteryChargingCondition BT Node
      • Behavior Server Error Codes
      • New Denoise Costmap Layer Plugin
      • SmacPlannerHybrid viz_expansions parameter
    • Iron to Jazzy
      • BehaviorTree.CPP upgraded to version 4.5+
      • Added TwistStamped Option for Commands
      • Add VelocityPolygon in Collision Monitor
      • Change polygon points parameter format in Collision Monitor
      • Introduction of Soft-Real Time Action Servers
      • opennav_coverage Project
      • opennav_docking Project
      • Introduce a new Multi-Robot Bringup Launch
      • New option for the Voxel and Obstacle Layers
      • use_interpolation RPP Parameter Depreciated
      • Changes to MPPI Goal Critic
      • Changes to MPPI Path Angle Critic
      • Changes to MPPI Path Handling For Directionality
      • Addition of new MPPI Cost Critic
      • MPPI Acceleration
      • Move Error Code Enumerations
      • Substitution in parameter file
      • Allow Behavior Server Plugins to Access The Action Result
      • Smac Planner Debug Param Name Change
      • Smac Planner On Approach to Goal Shortcutting Solutions
      • Added GPS Waypoint Follower Server
      • Smac Planner Hybrid-A* New Features
      • New node in nav2_collision_monitor: Collision Detector
      • Dynamic enabling/disabling of sources/polygons in Collision Monitor/Detector
      • Expose action server’s result timeout
      • RewrittenYaml could add new parameters to YAMLs
      • Simple Commander API Allows Multi-Robot Namespacing
      • Change duration type in wait_action node
      • The costmap activation fails when required transforms are not available
      • Subtrees Obtain Shared Resources
      • Collision Monitor: added watchdog mechanism based on source_timeout parameter with default blocking behavior
      • BtActionServer: use native library haltTree()
      • Global Frame Removed from 2 BT Nodes
      • Introduction of CostmapUpdate.msg
      • Full Stack Uses Node Clocks
      • New Graceful Motion Controller
      • Plugin Libraries in BT Navigator Only Includes Custom Nodes
      • New RViz Plugin for selecting Planners, Controllers, Goal Checkers, Progress Checkers and Smoothers
      • RPP new optional interpolate_curvature_after_goal behavior and fix conflict between use_rotate_to_heading and allow_reversing
      • Cancel Checker Interface For GlobalPlanner
      • New BtActionServer/BtNavigator parameter
      • New collision monitor parameter
      • New graceful cancellation API for Controllers
      • Standardization of Plugin Naming with Double Colons (::)
      • Collision monitor: dynamic radius for circle type polygons
      • Static Layer: new parameter footprint_clearing_enabled
      • Lifecycle Node: added bond_heartbeat_period parameter (and allow disabling the bond mechanism)
      • Rotation Shim Controller: new parameter rotate_to_goal_heading
      • MPPI Controller: Addition of acceleration constraints
      • RegulatedPurePursuit Controller [RPP]: new parameter use_cancel_deceleration
    • Jazzy to Kilted
      • Nav2 Route Server
      • BehaviorTree error_msg
      • TwistStamped Default CmdVel Change
      • New Nav2 Loopback Simulator
      • Docking with Static Infrastructure or Dynamic Docking
      • New RViz panel for Docking
      • BT Nodes Changes
      • New RViz Tool for Costmap Cost Cell Inspection
      • Fix flickering visualization
      • Option to limit velocity through DWB trajectory
      • Option to disable zero velocity publishing on goal exit
      • Rotation Shim Disengagement Threshold
      • Added optional collision checking for the Docking Server
      • Revamped multirobot bringup and config files to use namespaces
      • Removed global map_topic from Costmap node
      • Simplified Costmap2DROS constructors
      • Option to disable collision checking in DriveOnHeading, BackUp and Spin Actions
      • New Plugin Container Layer
      • Iterative Target Selection for the Graceful Controller
      • Conform to ROS 2 launch syntax in Turtlebot 3 multi-robot launch file
      • ComputePathThroughPoses, NavigateThroughPoses and other BT nodes now use nav_msgs/Goals instead of vector<PoseStamped>
      • MPPI controller re-implemented using Eigen library and performance improved by 40-45%
      • Enable goal orientation non-specificity
      • DriveOnHeading and BackUp behaviors: Addition of acceleration constraints
      • Rotation Shim Deceleration as a function of its target orientation
      • Rotation Shim Open-loop Control
      • Near collision cost in MPPI cost critic
      • Service introspection
      • Rotation Shim Using Path Orientations
      • MPPI - Publishing Optimal Trajectory
      • NavigateThroughPoses - Reporting waypoint statuses information
      • Groot 2 Support
      • Docking backwards as plugin parameter
  • Simple Commander API
    • Overview
    • Commander API
    • Costmap API
    • Footprint Collision Checker API
    • Examples and Demos
  • Roadmaps
    • Jazzy Roadmap
    • Iron Roadmap
    • Humble Roadmap
  • About and Contact
    • Related Projects
    • About
    • Contact
Nav2
Edit
  • Nav2 Behavior Trees
  • Navigate on Route Graph with Recovery

Navigate on Route Graph with Recovery

This behavior tree implements a different style of navigation than the other versions in this section. Rather than using a freespace planner ComputePathToPose to plan a complete path to the goal, this behavior tree instead uses the Route Server to find a route to the goal through a pre-defined navigation graph. This can be useful for navigating in large-scale environments where real-time planning in freespace for a long distance is not computationally feasible, where a map of the entire space is not possible to plan within, or where deterministic behavior and limited navigation zones/lanes/routes are demanded.

This tree computes a route through the environment using the ComputeRoute node which is executed on initialization and when either the goal is updated due to preemption (GlobalUpdatedGoal) or the current route path is invalid due to collision (isPathValid). After which, if the robot’s starting pose is too far from the first route node in the graph solution, it will use freespace planning to connect the robot’s current pose to the first node in the route. This is called the first mile and is computed using the ComputePathToPose node. This may be removed if navigation only on the graph is required and you know that the robot will always be located on or near the graph.

The complimentary action occurs for last mile where the robot will use freespace planning to connect the last node in the route to the goal pose. This is done using the ComputePathToPose node again and similarly can be removed if required. The compute path, including the first and last mile paths are then smoothed in the smoother server to make the corners more natural and less sharp. FollowPath is then used to follow this path.

For a detailed description of the role of the selector nodes, recovery behaviors, or fallbacks, see the other behavior tree explanations in this section.

<root BTCPP_format="4" main_tree_to_execute="MainTree">
  <BehaviorTree ID="MainTree">
    <RecoveryNode number_of_retries="6" name="NavigateRecovery">
      <PipelineSequence name="NavigateWithReplanning">
        <ControllerSelector selected_controller="{selected_controller}" default_controller="FollowPath" topic_name="controller_selector"/>
        <PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
        <RecoveryNode number_of_retries="1" name="ComputeRoute">
          <RateController hz="0.5" name="ComputeRouteRateController">
              <Fallback>
                <!-- Compute a new route if a new goal is found or the path is no longer valid -->
                <ReactiveSequence>
                  <Inverter>
                    <GlobalUpdatedGoal/>
                  </Inverter>
                  <IsPathValid path="{path}"/> <!-- Base it on the complete connected 'path', not simply the 'route_path' -->
                </ReactiveSequence>
                <Sequence name="ComputeAndSmoothRoute">
                  <!-- Compute the route -->
                  <ComputeRoute goal="{goal}" path="{route_path}" route="{route}" use_poses="true" error_code_id="{compute_route_error_code}" error_msg="{compute_route_error_msg}"/>

                  <!-- Find if the route start node is far from the robot's current pose; if so, connect them for 'first mile'. -->
                  <ReactiveSequence>
                    <GetCurrentPose current_pose="{current_pose}"/>
                    <GetPoseFromPath path="{route_path}" index="0" pose="{route_start_pose}"/>
                    <Inverter>
                      <ArePosesNear ref_pose="{current_pose}" target_pose="{route_start_pose}" tolerance="0.3"/>
                    </Inverter>
                    <ComputePathToPose goal="{route_start_pose}" path="{first_mile_path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
                    <ConcatenatePaths input_path1="{first_mile_path}" input_path2="{route_path}" output_path="{route_path}"/>
                  </ReactiveSequence>

                  <!-- Find if the route end node is far from the goal pose; if so, connect them for 'last mile'. -->
                  <ReactiveSequence>
                    <GetPoseFromPath path="{route_path}" index="-1" pose="{route_end_pose}"/>
                    <Inverter>
                      <ArePosesNear ref_pose="{goal}" target_pose="{route_end_pose}" tolerance="0.1"/>
                    </Inverter>
                    <ComputePathToPose start="{route_end_pose}" goal="{goal}" path="{last_mile_path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
                    <ConcatenatePaths input_path1="{route_path}" input_path2="{last_mile_path}" output_path="{route_path}"/>
                  </ReactiveSequence>

                  <!-- Smooth the completed route -->
                  <SmoothPath unsmoothed_path="{route_path}" smoothed_path="{path}" smoother_id="route_smoother" error_code_id="{smoother_error_code}" error_msg="{smoother_error_msg}"/>
                </Sequence>
              </Fallback>
            </RateController>
          <Sequence>
            <Fallback>
              <WouldARouteRecoveryHelp error_code="{compute_route_error_code}"/>
              <WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
            </Fallback>
            <ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
          </Sequence>
        </RecoveryNode>
        <RecoveryNode number_of_retries="1" name="FollowPath">
          <FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
          <Sequence>
            <WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
            <ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
          </Sequence>
        </RecoveryNode>
      </PipelineSequence>
      <Sequence>
        <Fallback>
          <WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
          <WouldAPlannerRecoveryHelp error_code="{compute_route_error_code}"/>
        </Fallback>
        <ReactiveFallback name="RecoveryFallback">
          <GoalUpdated/>
          <RoundRobin name="RecoveryActions">
            <Sequence name="ClearingActions">
              <ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
              <ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
            </Sequence>
            <Wait wait_duration="5.0" error_code_id="{wait_error_code}" error_msg="{wait_error_msg}"/>
            <BackUp backup_dist="0.30" backup_speed="0.15" error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
          </RoundRobin>
        </ReactiveFallback>
      </Sequence>
    </RecoveryNode>
  </BehaviorTree>
</root>

© Copyright 2023.