| Crates.io | mecha10-nodes-behavior-executor |
| lib.rs | mecha10-nodes-behavior-executor |
| version | 0.1.39 |
| created_at | 2025-11-25 02:59:04.885051+00 |
| updated_at | 2026-01-09 17:02:41.913204+00 |
| description | Behavior tree executor node for autonomous robot behaviors |
| homepage | |
| repository | https://github.com/mecha10/mecha10 |
| max_upload_size | |
| id | 1949113 |
| size | 97,442 |
Loads and executes behavior trees for autonomous robot control.
The behavior executor node runs behavior trees at a configurable tick rate, providing autonomous control for robots. It supports enable/disable control from the dashboard and advanced interrupt/resume functionality for seamless integration with manual control.
# Behavior Executor Configuration
behavior_name = "patrol" # Name of behavior to load (from behaviors/)
behaviors_dir = "behaviors" # Directory containing behavior JSON files
tick_rate_hz = 10.0 # Execution frequency in Hz
max_ticks = 10000 # Optional maximum tick count
log_stats = true # Log periodic statistics
[topics]
control = "/behavior/control" # Control topic for enable/disable/interrupt/resume
status = "/behavior/status" # Status publishing topic
The behavior executor listens to /behavior/control for control commands:
Enable Behavior Tree
{
"action": "enable",
"timestamp": 1234567890
}
Disable Behavior Tree
{
"action": "disable",
"timestamp": 1234567890
}
Interrupt with Auto-Resume
{
"action": "interrupt",
"source": "llm-command",
"duration_secs": 30,
"timestamp": 1234567890
}
When duration_secs is provided, the behavior tree will automatically resume after the timeout.
Manual Resume
{
"action": "resume",
"source": "llm-command",
"timestamp": 1234567890
}
Resumes the behavior tree immediately, cancelling any pending auto-resume.
Published to /behavior/status every second:
{
"behavior_name": "patrol",
"is_running": true,
"tick_count": 12345,
"timestamp": 1234567890
}
enable command from dashboard1. Behavior tree is running (enabled)
2. Receives "interrupt" command from node (e.g., llm-command)
→ Behavior execution pauses
→ If duration_secs provided, schedules auto-resume
3. Manual command executes
4. After timeout OR manual resume:
→ Behavior tree resets and resumes execution
Dashboard:
- "Enable" button → Starts behavior tree
- "Disable" button → Stops behavior tree
Nodes:
- Send "interrupt" → Pauses for user command
- Send "resume" → Resumes autonomous behavior
Behavior trees are loaded from JSON files in the behaviors/ directory:
Example: behaviors/patrol.json
{
"type": "Sequence",
"children": [
{
"type": "wander",
"params": {
"linear_speed": 0.3,
"angular_speed": 0.5,
"duration_secs": 5.0
}
},
{
"type": "timer",
"params": {
"duration_secs": 2.0
}
}
]
}
Moves the robot with random velocity:
{
"type": "wander",
"params": {
"linear_speed": 0.3,
"angular_speed": 0.5,
"duration_secs": 5.0
}
}
Moves with fixed velocity:
{
"type": "move",
"params": {
"linear": 0.5,
"angular": 0.0,
"duration_secs": 3.0
}
}
Waits for a duration:
{
"type": "timer",
"params": {
"duration_secs": 2.0
}
}
Checks sensor values:
{
"type": "sensor_check",
"params": {
"sensor_topic": "/sensors/proximity",
"condition": "greater_than",
"threshold": 0.5
}
}
The behavior executor works seamlessly with the llm-command node:
This provides a natural "take control, then hand back" UX.
The node is launched automatically by mecha10 dev when included in mecha10.json.
To run manually:
cargo run -p mecha10-nodes-behavior-executor
The health check monitors:
If the behavior status is Failure, the health check reports unhealthy.