git clone --depth 1 https://github.com/harunkurtdev/ros2-claude-code-template /tmp/nav2_behavior_tree && cp -r /tmp/nav2_behavior_tree/.claude/skills/nav2_behavior_tree ~/.claude/skills/nav2_behavior_treeSKILL.md
# Nav2 Behavior Tree Nodes & Behaviors
Source: `~/nav2_ws/src/navigation2/nav2_behavior_tree/` and `nav2_bt_navigator/` and `nav2_behaviors/`
## BT Navigator
**Package:** `nav2_bt_navigator`
**Actions:** `NavigateToPose`, `NavigateThroughPoses`
Orchestrates planning, control, and recovery via Behavior Tree XML files. Loads BT node plugins dynamically.
### Navigator Plugins
- `NavigateToPoseNavigator` - Single goal navigation
- `NavigateThroughPosesNavigator` - Multi-goal navigation
---
## BT Node Inventory (82 total)
### Action Nodes (47)
#### Navigation
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `NavigateToPose` | Navigate to single goal | goal, behavior_tree, error_code_id |
| `NavigateThroughPoses` | Navigate through goals | goals, behavior_tree, error_code_id |
| `ComputePathToPose` | Plan to single goal | goal, start, path, planner_id, error_code_id |
| `ComputePathThroughPoses` | Plan through goals | goals, start, path, planner_id, error_code_id |
| `FollowPath` | Execute path following | path, controller_id, goal_checker_id, error_code_id |
| `SmoothPath` | Smooth a path | unsmoothed_path, smoothed_path, smoother_id, error_code_id |
| `ComputeRoute` | Graph-based route plan | goal, start, route, path, error_code_id |
| `ComputeAndTrackRoute` | Route plan + tracking | goal, start, error_code_id |
#### Path Operations
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `TruncatePath` | Cut path before goal | input_path, output_path, distance |
| `TruncatePathLocal` | Cut path in local frame | input_path, output_path, distance_forward, distance_backward |
| `ConcatenatePaths` | Join two paths | path1, path2, output_path |
| `GetPoseFromPath` | Extract pose at index | path, index, pose |
#### Recovery Behaviors
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `Spin` | Rotate in place | spin_dist (rad), time_allowance, error_code_id |
| `BackUp` | Reverse motion | backup_dist, backup_speed, time_allowance, error_code_id |
| `DriveOnHeading` | Move on heading | dist_to_travel, speed, time_allowance, error_code_id |
| `Wait` | Pause execution | wait_duration, error_code_id |
| `AssistedTeleop` | Collision-safe teleop | time_allowance, error_code_id |
| `FollowObject` | Follow tracked object | pose_topic, tracked_frame, error_code_id |
| `DockRobot` | Dock at station | dock_id, dock_type, error_code_id |
| `UndockRobot` | Undock from station | dock_type, error_code_id |
#### Goal Management
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `AppendGoalPoseToGoals` | Add goal to vector | goal, goals |
| `RemovePassedGoals` | Remove reached goals | input_goals, output_goals, radius |
| `RemoveInCollisionGoals` | Filter collision goals | input_goals, output_goals |
| `GetNextFewGoals` | Get subset of goals | input_goals, output_goals, number |
| `ExtractRouteNodesAsGoals` | Route nodes → goals | route, goals |
| `GetCurrentPose` | Get robot's current pose | current_pose |
#### Costmap Operations
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `ClearEntireCostmap` | Clear all costmap | service_name ("global" or "local") |
| `ClearCostmapExceptRegion` | Clear except area | service_name, reset_distance |
| `ClearCostmapAroundRobot` | Clear near robot | service_name, reset_distance |
| `ClearCostmapAroundPose` | Clear near pose | service_name, pose, reset_distance |
#### Plugin Selectors
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `PlannerSelector` | Choose planner | topic, selected_planner |
| `ControllerSelector` | Choose controller | topic, selected_controller |
| `SmootherSelector` | Choose smoother | topic, selected_smoother |
| `GoalCheckerSelector` | Choose goal checker | topic, selected_goal_checker |
| `ProgressCheckerSelector` | Choose progress checker | topic, selected_progress_checker |
| `PathHandlerSelector` | Choose path handler | topic, selected_path_handler |
#### Cancel Actions
| Node | Purpose |
|------|---------|
| `CancelControl` | Cancel FollowPath |
| `CancelBackUp` | Cancel BackUp |
| `CancelSpin` | Cancel Spin |
| `CancelDriveOnHeading` | Cancel DriveOnHeading |
| `CancelWait` | Cancel Wait |
| `CancelAssistedTeleop` | Cancel AssistedTeleop |
| `CancelFollowObject` | Cancel FollowObject |
| `CancelComputeAndTrackRoute` | Cancel route tracking |
#### Services
| Node | Purpose |
|------|---------|
| `ReinitializeGlobalLocalization` | Reset AMCL |
| `ToggleCollisionMonitor` | Enable/disable collision monitor |
---
### Condition Nodes (22)
| Node | Purpose | Key Ports |
|------|---------|-----------|
| `GoalReached` | Goal position reached? | goal, global_frame, robot_base_frame |
| `GoalUpdated` | New goal received? | - |
| `GlobalUpdatedGoal` | Globally updated goal? | - |
| `IsGoalNearby` | Goal near in path? | path, goal, distance_threshold |
| `ArePosesNear` | Two poses close? | pose1, pose2, tolerance |
| `IsPathValid` | Path collision-free? | path, server_timeout |
| `IsWithinPathTrackingBounds` | Robot on path? | path, bounds |
| `DistanceTraveled` | Moved far enough? | distance, global_frame |
| `IsStuck` | Robot stuck? | - |
| `IsStopped` | Robot stopped? | velocity_threshold |
| `IsPoseOccupied` | Pose in obstacle? | pose |
| `InitialPoseReceived` | Initial pose set? | - |
| `TransformAvailable` | TF transform exists? | child, parent |
| `TimeExpired` | Time elapsed? | seconds |
| `PathExpiringTimer` | Path update timer | seconds, path |
| `IsBatteryLow` | Battery low? | min_battery, battery_topic, is_voltage |
| `IsBatteryCharging` | Charging? | battery_topic |
| `WouldAPlannerRecoveryHelp` | Planner recovery needed? | error_code |
| `WouldAControllerRecoveryHelp` | Controller recovery? | error_code |
| `WouldASmootherRecoveryHelp` | Smoother recovery? | error_code |
| `WouldARouteRecoveryHelp` | Route recovery? | error_code |
| `AreErrorCodesPresent` | Match error codes | error_code, error_codes_to_check |
---
### Control Nodes (6)
| Node | PurpUse proactively before opening a PR that adds or changes BehaviorTree.CPP nodes or BehaviorTree.ROS2 wrappers (RosActionNode/RosServiceNode/RosTopicPub/SubNode, TreeExecutionServer). Reviews a diff against BT.CPP v4 conventions — node base-class choice, non-blocking ticks, ports/blackboard typing, factory/plugin registration, XML v4, and the ROS 2 wrapper contract. Returns a punch list with file:line anchors, not a rewrite.
Use when a design decision touches Clean Architecture boundaries in a ROS 2 project — which layer a new behaviour belongs to, whether a port belongs in domain or application, whether a new node should be lifecycle-managed, whether to compose nodes or split packages. Returns an architectural recommendation with trade-offs, not implementation.
Use when a design decision touches the gz-sim ECS — where new state should live, which system phase should write it, how to avoid coupling, whether to add a component vs. a member variable, whether a new system should be split or merged with an existing one. Returns an architectural recommendation with trade-offs, not implementation.
Use proactively before opening any gz-sim PR. Reviews a diff against the project's C++17 style, ECS conventions, plugin registration patterns, CMake structure, test placement, Migration.md / Changelog.md expectations, and pre-commit configuration. Returns a punch list, not a rewrite.
Use proactively before opening a PR that adds or changes a ros2_control controller, broadcaster, or hardware component (incl. URDF <ros2_control> bringup). Reviews a diff against ros2_controllers / ros2_control_demos conventions — controller & hardware lifecycle, command/state interface configuration, real-time safety of update()/read()/write(), generate_parameter_library usage, pluginlib registration, chainable-controller correctness, URDF wiring, and tests. Returns a punch list with file:line anchors, not a rewrite.
Use proactively before opening any ROS 2 / Nav 2 PR. Reviews a diff against this template's Clean Architecture, ROS 2 communication, lifecycle, testing, and Nav 2 plugin conventions. Returns a punch list with file:line anchors, not a rewrite.
Use proactively before opening a PR that touches a VDA 5050 connector / fleet bridge. Reviews a diff against VDA 5050 v3.0.0 protocol compliance (topics, QoS, header rules, base/horizon, action state machine, schema validation) and the template's Clean Architecture for the MQTT↔Nav 2 bridge. Returns a punch list with file:line anchors, not a rewrite.
Build the colcon workspace (optionally a single package) and report the outcome.