patrol-behavior-tree

Builds a BehaviorTree.CPP XML tree for cyclic waypoint patrol with battery monitoring and recovery.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill patrol-behavior-tree-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: patrol-behavior-tree
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/patrol-behavior-tree
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill patrol-behavior-tree-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a robust patrol behavior for an autonomous robot requires coordinating waypoint navigation, battery safety, and anomaly response without writing fragile imperative logic. This Skill provides a complete BehaviorTree.CPP XML architecture that handles these concerns declaratively. ## Core Features & Use Cases - Layered Mission Control: A ReactiveFallback prioritizes battery emergencies, intruder response, and normal patrol in a single re-evaluated tree. - Navigation with Recovery: Each waypoint visit wraps path planning, smoothing, and path-following in a Retry(3) decorator with 2 Hz path validity monitoring. - Dual Battery Thresholds: 10% triggers immediate charging that preempts everything; 20% gracefully halts patrol and waits at the charger until 80%. - Use Case: A security robot patrols four rooms indefinitely, pauses to photograph and log a detected person, and autonomously returns to its charger when the battery drops. ## Quick Start Ask the AI to generate a patrol behavior tree XML for your waypoints using this Skill, then load the output into your Nav2 BT navigator configuration.

Frequently Asked Questions about patrol-behavior-tree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a patrol behavior tree in BehaviorTree.CPP?

Define a main tree with a ReactiveFallback for mission priorities, a PatrolLoop subtree using KeepRunningUntilFailure over waypoint subtrees, and a NavigateWithRecovery subtree wrapping plan, smooth, and follow actions in a Retry decorator.

How to add battery monitoring to a Nav2 behavior tree?

Place an IsBatteryLow condition inside a ReactiveSequence at the top of a ReactiveFallback so it is re-evaluated every tick. Use two thresholds, such as 10% for emergency preemption and 20% for graceful patrol interruption.

What is the difference between ReactiveSequence and ReactiveFallback in BehaviorTree.CPP?

ReactiveSequence re-ticks all preceding conditions and halts running children if one fails, while ReactiveFallback re-evaluates children in priority order and returns the first success. The patrol tree uses ReactiveFallback so battery emergencies preempt all other behaviors.

Does this behavior tree work with ROS2 Nav2?

Yes, it uses standard Nav2 BT action nodes such as ComputePathToPose, SmoothPath, FollowPath, and IsPathValid with their server names. Waypoints are injected into the blackboard from a YAML parameter file in the BT navigator configuration.

Why does my patrol tree stop after navigation fails repeatedly?

The Retry decorator is configured with 3 attempts, so after three failures the subtree returns FAILURE and the patrol moves on or the loop stops. Increase num_attempts or add a recovery subtree if transient obstacles cause frequent failures.