Custom Nav2 Behavior Tree plugin for multi-robot proximity-aware yielding in CHARS.
This package adds a BT node, CheckRobotProximity, that pauses a robot when a higher-priority robot is too close, then resumes automatically once the area is clear.
- Implements
CheckRobotProximityas a Nav2 BT plugin (nav2_proximity_wait_bt_node). - Uses TF lookups to measure 2D distance between robots.
- Uses priority-based right-of-way from robot namespace IDs (
agent1>agent2in priority). - Uses hysteresis thresholds:
safety_radius: start yieldingclear_radius: resume motion
- Integrates into a custom Nav2 BT XML where
FollowPathis gated by proximity checks.
When yielding, the node returns RUNNING (not FAILURE), which cleanly pauses progress without creating tight BT spin loops.
nav2_proximity_wait/
include/nav2_proximity_wait/check_robot_proximity.hpp
src/check_robot_proximity.cpp
bt_xml/navigate_w_proximity_wait.xml
config/bt_navigator_proximity.yaml
config/fleet_config.yaml
CMakeLists.txt
package.xml
From package.xml:
rclcppnav2_behavior_treebehaviortree_cpp_v3geometry_msgstf2tf2_rostf2_geometry_msgsnav2_msgsnav2_util
From your ROS 2 workspace root:
colcon build --packages-select nav2_proximity_wait
source install/setup.bashUse config/bt_navigator_proximity.yaml and ensure plugin_lib_names includes:
- nav2_proximity_wait_bt_nodePoint Nav2 default_nav_to_pose_bt_xml to:
<this_package>/bt_xml/navigate_w_proximity_wait.xml
The node reads these ROS parameters directly from bt_navigator:
other_robot_frames(semicolon-delimited TF frames)safety_radiusclear_radius
Example values:
other_robot_frames: "agent1/base_link;agent3/base_link"
safety_radius: 1.0
clear_radius: 1.5config/fleet_config.yaml can be used as the single source of truth for swarm namespaces and radii, then expanded in your launch logic into per-robot bt_navigator parameters.
On each BT tick:
- Compute distance from self frame to every frame in
other_robot_frames. - If distance <
safety_radiusand another robot has higher priority, returnRUNNING(yield). - While yielding, stay in
RUNNINGuntil distance >clear_radius. - Then return
SUCCESS, allowingFollowPathto continue.
Priority is extracted from frame namespace digits (example: agent2/base_link -> priority 2). Lower number means higher right-of-way.
This package supports Layer 1 execution robustness in CHARS by reducing local navigation conflicts in multi-robot operation, especially in narrow shared corridors and approach zones.
package.xml currently has placeholder fields for description and license (TODO). Update these before publishing the repository to avoid package indexing and compliance confusion.
Source files include Apache-2.0 headers. Align package.xml license value accordingly before release.