Behavior Tree

Behavior Tree is a modular, hierarchical decision model that is widely used in robot control, and game development. It present some similarities to hierarchical state machines with the key difference that the main building block of a behavior is a task rather than a state. Behavior Tree have been shown to generalize several other control architectures (https://ieeexplore.ieee.org/document/7790863)

Example

Visualize the behavior tree by xml-tree-visual.

../../../_images/robot_behavior_case.svg

Print the behavior tree

Behavior Tree
[Robot Main Controller]
    [Battery Management]
        (Low Battery Detection)
            <Check Battery>
        <Low Battery Warning>
        <Charge Battery>
    [Patrol Task]
        <Start Task>
        [Move to Position A]
            <Move to A>
            [Obstacle Handling A]
                [Obstacle Present]
                    <Detect Obstacle>
                    <Avoid Obstacle>
                <No Obstacle>
            <Position A Task>
        [Move to Position B]
            (Short Wait)
                <Prepare Movement>
            <Move to B>
            (Limited Time Obstacle Handling)
                [Obstacle Present]
                    <Detect Obstacle>
                    <Avoid Obstacle>
            <Position B Task>
        [Conditional Move to C]
            <Check Sufficient Battery>
            [Perform Position C Task]
                <Move to C>
                (Ensure Completion)
                    <Position C Task>
            <Skip Position C>
        <Complete Patrol>
        <Return to Charging Station>
Behavior Tree