Behavior Trees

v0.2.0
io.github.behaviortrees/behaviortrees Checked 14 hours ago Published 17 days ago

Validate, convert (behavior3 JSON, BehaviorTree.CPP XML) and open behavior trees in a visual editor

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

validate_tree Validate a behavior tree

Checks a behavior tree for errors: missing or dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children, unknown node names, and BehaviorTree.CPP import problems. Returns valid (true when there are no errors), the trees found, and findings at error, warning or info level.

ParameterTypeDescription
tree *The tree: behavior3 JSON: {"title": "...", "root": "<id of the first node under the root>", "nodes": {"<id>": {"name": "<node type>", "title": "<optional label>", "children": ["<id>", ...] (composites…

convert_tree Convert a behavior tree

Convert between behavior3 JSON and BehaviorTree.CPP XML (v4 for ROS 2 Jazzy and Groot2, v3 for ROS 2 Humble), the same way the editor imports and exports. Returns the converted text and any issues (BT.CPP has no equivalent for some behavior3 nodes and vice versa).

ParameterTypeDescription
to *stringTarget format: behavior3, btcpp-v4 or btcpp-v3
tree *The tree: behavior3 JSON: {"title": "...", "root": "<id of the first node under the root>", "nodes": {"<id>": {"name": "<node type>", "title": "<optional label>", "children": ["<id>", ...] (composites…

list_node_types List built-in node types

The built-in behavior3 nodes a tree can use without declaring them: composites (Sequence, Priority = selector/fallback, MemSequence, MemPriority), decorators (Inverter, Repeater, MaxTime, ...) and leaves (Wait, Succeeder, Failer, ...), with descriptions and default properties.

get_example Get an example tree

Complete, working example trees (enemy patrol, cooldown-gated attacks, robot navigation with recovery, and more) to learn the format from or start with. Without an id, lists the examples; with an id, returns that tree as behavior3 JSON.

ParameterTypeDescription
idstringExample id from the list; omit to list them

read_guide Read a behavior tree guide

Practical guides from behaviortrees.com/learn as Markdown: what behavior trees are, node types, blackboards, debugging, structuring large trees, and behavior trees in Unity, Unreal, Godot, Python and robotics (BehaviorTree.CPP, ROS 2, Nav2). Without a slug, lists the guides.

ParameterTypeDescription
slugstringGuide slug from the list; omit to list them