Artificial intelligence
Behavior tree
Definition
A behavior tree is a hierarchical control structure that selects and switches between an autonomous system's actions according to the status returned by its child nodes. Robots use behavior trees to compose reactive task logic from reusable actions and conditions.
Also known as: Behaviour tree, BT
Updated
Status-driven task selection
A behavior tree is evaluated through ticks sent from its root towards its leaves. Leaf nodes normally test a condition or run an action. An action reports a status such as running, success, or failure, and control-flow nodes use that status to decide which child to tick next. The BehaviorTree.CPP documentation describes this callback and status interface in a widely used robotics implementation.
Sequence nodes can require children to succeed in order, while fallback or selector nodes can try alternatives after a failure. Decorators can modify a child's execution rule. This hierarchy keeps switching logic in the tree instead of distributing every transition among the actions.
Use in robot task execution
A service robot might first check that an object has been perceived, then navigate, grasp, and place it. A fallback branch can trigger another view or a recovery action when grasping fails. The same navigation or perception leaf can appear in several task trees without rewriting its controller.
Colledanchise and Ögren formalise behavior trees as structures for switching among tasks and discuss modularity, reactivity, analysis, planning, and learning. A behavior tree can organise skills produced by task and motion planning, a learned policy, or conventional control code. It is the task-level coordinator, not the motion controller inside each leaf.
Behavior trees and finite-state machines can express many of the same behaviours. In a finite-state machine, transition rules are commonly attached to states. In a behavior tree, hierarchical control-flow nodes repeatedly select leaves from their returned status. The robotics survey identifies this centralised tree structure as a reason individual behaviours can be easier to extend and reuse.
Structure does not guarantee good behaviour
A readable tree can still invoke an unsafe or poorly tested action. A high-priority branch that never stops reporting running can prevent lower-priority work. Parallel nodes, shared data, action cancellation, and long-running hardware operations also need explicit semantics.
Reactivity depends on tick rate and on how quickly leaves halt or return. Formal analysis needs assumptions about the leaf controllers and environment, not just the visible tree. Large generated trees can become difficult to inspect even though each node is simple, so simulation, logging, timeouts, and safety constraints remain necessary.
Sources
Related terms
Task and motion planning
Task and motion planning jointly searches over discrete task decisions and continuous robot motions. It connects choices such as which object to move or which grasp to use with geometrically and kinematically feasible trajectories.
Generalist robot policy
A generalist robot policy is a learned action-selection model designed to perform multiple tasks across a range of robot settings. Its generality depends on the tasks, observations, action interfaces, and robot bodies included in training and evaluation.
Robotic manipulation
Robotic manipulation is the use of a robot to change an object's position, orientation, or state through physical interaction. It includes grasping and moving objects as well as actions such as pushing or carrying them without a grasp.
Reinforcement learning
Reinforcement learning trains an agent to choose actions that maximize expected cumulative reward through experience with an environment. In robotics, the learned policy can select movements or higher-level behaviors from observations.