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
        • SWAGGER Route Graph Generation
      • Description
      • Demonstration
    • Navigating with Vector Objects
      • Overview
      • Requirements
      • Configuring Vector Object Server
      • Preparing Nav2 stack
      • Demo Execution
      • Working with Vector Objects
  • 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
        • ClearCostmapAroundPose
        • 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
        • NonblockingSequence
        • PersistentSequence
        • PauseResumeController
      • 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
        • PositionGoalChecker
      • 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
        • Default Optimal Trajectory Validator
        • 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
      • Map Server
        • Map Server Parameters
      • Map Saver
        • Map Saver Parameters
      • Costmap Filter Info Server
        • Costmap Filter Info Server Parameters
        • Example
      • Vector Object Server
        • Features
        • Covered use-cases
        • 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
      • Configuring the Nav2 Route Server Demo
  • 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
      • Control: NonblockingSequence
      • Control: PersistentSequence
      • Control: PauseResumeController
    • 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
      • Clear Costamp Around Passed Pose
    • 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
      • New Position Goal Checker
      • Docking backwards without sensor
      • RegulatedPurePursuit Controller [RPP]: new parameter stateful
      • Controller Server Frequency Removed Dynamic Parameter
      • Default bringup supports keepout, speed zones, and route planning
    • Kilted to L-turtle
      • New Nav2 ROS Common & Nav2 Lifecycle Node
        • Plugin Migration
        • Service Client Migration
        • Service Server Migration
        • Action Server Migration
        • Action Client Migration
        • Publisher Subscriber Migration
      • Removed Parameter action_server_result_timeout
      • Added Corner Smoothing functionality to route_server
      • Added NonblockingSequence Control Node
      • MPPI Optimal Trajectory Validator Plugin
      • Added PersistentSequence and PauseResumeController Control Nodes
      • Option to use point_cloud_transport
        • Configuration guide
        • Performance Metrics
      • Private BT Navigator’s BlackBoard ID parameters
      • Option to have custom window size and poly order in Savitsky-Golay Smoother
      • Vector Objects were Supported for Raster Maps
  • Simple Commander API
    • Overview
    • Commander API
    • Costmap API
    • Footprint Collision Checker API
    • Examples and Demos
  • API Docs
  • Roadmaps
    • Jazzy Roadmap
    • Iron Roadmap
    • Humble Roadmap
  • Citations
  • About and Contact
    • Related Projects
    • About
    • Contact
  • Maintainer Docs
    • ROS Distribution Release Process
      • 0. Initial Freeze
      • 1. Local Functional Testing
      • 2. Setup Nav2 Docker Images
      • 2. Branch Off Distribution
      • 3. Setup Branch CI
      • 4. Update Auxiliary Projects
      • 5. Run Bloom Release
      • 6. Nav2 Docker Build
      • 7. Announcements
    • ROS Distribution Sync Process
      • 0. Initial Setup
      • 1. Backporting Process
      • 2. Testing
      • 3. Open a PR
      • 4. Bloom Release
Nav2
Edit
  • General Tutorials
  • Navigating with Vector Objects

Navigating with Vector Objects

  • Overview

  • Requirements

  • Configuring Vector Object Server

  • Preparing Nav2 stack

  • Demo Execution

  • Working with Vector Objects

../../_images/vector_objects_demo.gif

Overview

This tutorial shows how to navigate with vector objects added to raster costmaps. They can be used for various purposes, such as programmatically generating complete occupancy grid maps for navigation, adding virtual static/dynamic obstacles on an existing map, or like Costmap Filters do with rastered maps, but on a vector (polygon or shape) basis rather than annotating a map-sized mask.

In this tutorial, the added vector objects will be treated as obstacles in costmaps using a Keepout Filter. To do this, we need to prepare the Nav2 stack with the Keepout Filter enabled, along with the Vector Object server which publishes an OccupancyGrid map with the rasterized vector objects as an input mask for the Keepout Filter. Other use cases use similar principles and could be easily adapted after finishing this tutorial.

Note

Using with Keepout Filter is a good choice for adding virtual obstacles or removing some areas from costmaps. However, the Vector Object server is not restricted to this application. It can be paired with different Costmap Filters for other use cases or even other applications entirely. For example, to represent polygonal speed restriction areas, a polygon-defined room where the camera is to be turned off using the Binary Filter, or using custom spatial / polygon applications.

Requirements

It is assumed ROS 2 and Nav2 dependent packages are installed or built locally. Please follow the instructions in Build and Install. For the best understanding how Keepout Filter works (which is the part of current configuration), it is also recommended to pass through the Navigating with Keepout Zones tutorial.

Configuring Vector Object Server

Vector Object server has its own vector_object_server.launch.py launch-file and preset parameters in the vector_object_server_params.yaml file for demonstration, though its trivial to add this to Nav2’s main launch file if being used in practice.

In this tutorial, we are focusing on the application how to utilize the simple setup allowing to add virtual obstacles on costmaps. For demonstration purposes, let’s specify two obstacle shapes: triangle polygon and circle filled with “occupied” value, in order to prevent the robot to go through them. The YAML-part for polygon and circle will look as follows:

shapes: ["Poly", "Circle"]
Poly:
  type: "polygon"
  frame_id: "map"
  closed: True
  value: 100
  points: [0.3, 0.5, -0.4, 1.2, -0.4, -0.2]
Circle:
  type: "circle"
  frame_id: "map"
  fill: True
  value: 100
  center: [1.5, 0.5]
  radius: 0.7

Where the triangle polygon is specified by {0.3, 0.5}, {-0.4, 1.2}, {-0.4, -0.2} 3-point shape and the circle has {1.5, 0.5} coordinate of its center with 0.7 meter radius in the map frame. closed true-value for the polygon and fill for the circle mean that both shapes to be filled the with specified value. This value is equal to 100 which means “occupied” in OccupancyGrid format.

Note

The frame for vector objects were specified the same as map’s global frame. It was chosen for the simplicity to have static objects on map. However, it is possible to specify the shape in any frame different from global map’s one. For this case, Vector Object server will use dynamic output map processing & publishing, suitable for moving objects.

Note

Each shape is being addressed by UUID, which could be specified manually in a string format. In the demonstration, it was skipped to specify UUID of the shapes in the parameters, so Vector Object server will automatically generate a new one for each shape. The list of UUID could be obtained later by calling GetShapes.srv service.

Costmap Filters require CostmapFilterInfo.msg message to be published along with filter mask (rasterized map with vector shapes). Costmap Filter Info message is being published by Costmap Filter Info server, which is also launched by the vector_object_server.launch.py script.

The complete vector_object_server_params.yaml YAML-file for the demonstration looks as follows:

vector_object_server:
  ros__parameters:
    map_topic: "vo_map"
    global_frame_id: "map"
    resolution: 0.05
    default_value: -1
    overlay_type: 0
    update_frequency: 1.0
    transform_tolerance: 0.1
    shapes: ["Poly", "Circle"]
    Poly:
      type: "polygon"
      frame_id: "map"
      closed: True
      value: 100
      points: [0.3, 0.5, -0.4, 1.2, -0.4, -0.2]
    Circle:
      type: "circle"
      frame_id: "map"
      fill: True
      value: 100
      center: [1.5, 0.5]
      radius: 0.7
costmap_filter_info_server:
  ros__parameters:
    type: 0
    filter_info_topic: "vo_costmap_filter_info"
    mask_topic: "vo_map"
    base: 0.0
    multiplier: 1.0

More detailed information about each Vector Object server parameter and its operating principle could be found on Vector Object Server configuration guide page. Costmap Filter Info server parameters description could be found at Costmap Filter Info Server page.

After Vector Objects and Costmap Filters Info servers were configured, launch them by command from below. Robot should bypass vector obstacles. For the demonstration purposes it is enough to avoid path planning through them.

ros2 launch nav2_map_server vector_object_server.launch.py

Preparing Nav2 stack

Vector Object server puts shapes to OccupacyGrid map and publishes it in a topic, which is used as an input mask for enabled in Nav2 Keepout Filter. Enabling of Keeput Filter in Nav2 stack principles are similar as written in Navigating with Keepout Zones tutorial. Since vector objects are being enabled in global costmaps, Keepout Filter called as “vector_object_layer”, should be added to the global costmap section of the nav2_params.yaml standard Nav2 configuration as follows:

global_costmap:
  ros__parameters:
    plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
    filters: ["keepout_filter", "speed_filter", "vector_object_layer"]
    ...
    vector_object_layer:
      plugin: "nav2_costmap_2d::KeepoutFilter"
      enabled: True
      filter_info_topic: "vo_costmap_filter_info"

Demo Execution

After Vector Object server was launched and Vector Object layer was enabled for the global costmap, run Nav2 stack as written in Getting Started:

ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False

We are using composable nodes technology, so in the console where Vector Object server run the following message should appear:

[leha@leha-PC nav2_ws]$ ros2 launch nav2_map_server vector_object_server.launch.py
[INFO] [launch]: All log files can be found below /home/leha/.ros/log/2023-11-24-13-18-42-257011-leha-PC-18207
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/lifecycle_manager_vo_server' in container 'nav2_container'
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/vector_object_server' in container 'nav2_container'
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/costmap_filter_info_server' in container 'nav2_container'

The last lines mean that all three nodes: Vector Object server, Costmap Filter Info server, and the Lifecycle Manager handling them, were successfully loaded into the Nav2 container nav2_container.

Set the initial pose for the robot, and check that vector objects were appeared on global costmap:

../../_images/vector_objects_on_costmap.png

As well as for the Keepout Filter, robot will consider vector objects as obstacles on costmaps and will avoid them:

../../_images/vector_objects_avoidance.png

Working with Vector Objects

During the operation, vector objects can be changed, added or removed. Let’s change triangle shape to the bar.

As was mentioned above, each shape is handled by its own UUID, which is being generated by Vector Object server if it is not specified explicitly in parameters. To obtain shapes UUID, run the GetShapes.srv service request from the console:

ros2 service call /vector_object_server/get_shapes nav2_msgs/srv/GetShapes

The output is expected to be the as follows:

requester: making request: nav2_msgs.srv.GetShapes_Request()

response:
nav2_msgs.srv.GetShapes_Response(circles=[nav2_msgs.msg.CircleObject(header=std_msgs.msg.Header(stamp=builtin_interfaces.msg.Time(sec=0, nanosec=0), frame_id='map'), uuid=unique_identifier_msgs.msg.UUID(uuid=array([73, 141, 241, 249, 116, 24, 69, 81, 178, 153, 159, 19, 245, 152, 28, 29], dtype=uint8)), center=geometry_msgs.msg.Point32(x=1.5, y=0.5, z=0.0), radius=0.699999988079071, fill=True, value=100)], polygons=[nav2_msgs.msg.PolygonObject(header=std_msgs.msg.Header(stamp=builtin_interfaces.msg.Time(sec=0, nanosec=0), frame_id='map'), uuid=unique_identifier_msgs.msg.UUID(uuid=array([153, 128, 30, 121, 241, 60, 76, 15, 140, 187, 58, 60, 164, 241, 97, 39], dtype=uint8)), points=[geometry_msgs.msg.Point32(x=0.30000001192092896, y=0.5, z=0.0), geometry_msgs.msg.Point32(x=-0.4000000059604645, y=1.2000000476837158, z=0.0), geometry_msgs.msg.Point32(x=-0.4000000059604645, y=-0.20000000298023224, z=0.0)], closed=True, value=100)])

In our case, UUID for triangle polygon will be [153, 128, 30, 121, 241, 60, 76, 15, 140, 187, 58, 60, 164, 241, 97, 39].

Calling AddShapes.srv service will add new shape if no UUID was specified, or given UUID was not found. If UUID is already existing, the shape will be updated. The triangle to be changed to the bar polygon with 4 points. Call the following service request with obtained UUID to do this:

ros2 service call /vector_object_server/add_shapes nav2_msgs/srv/AddShapes "polygons: [{points: [{x: 0.0, y: 1.0}, {x: -0.5, y: 1.0}, {x: -0.5, y: 0.0}, {x: 0.0, y: 0.0}], closed: true, value: 100, uuid: {uuid: [153, 128, 30, 121, 241, 60, 76, 15, 140, 187, 58, 60, 164, 241, 97, 39]}}]"

The polygon shape in Vector Object server will be changed, vo_map will be updated and resulting costmap will look as follows - triangle obstacle was updated to bar:

../../_images/vector_objects_updated.png

Finally, remove all shapes from map. To remove any existing shape, there is RemoveShapes.srv service supported. It has array of UUID-s to specify which shapes to remove or just all_objects option for the case if we want to remove all shapes at once. Let’s do the latter:

ros2 service call /vector_object_server/remove_shapes nav2_msgs/srv/RemoveShapes "all_objects: true"

As a result, all vector shapes were disappeared from global costmap:

../../_images/vector_objects_removed.png

© Copyright 2025, Open Navigation LLC.