Skip to main content

Module: intrinsic.solutions.behavior_tree

Python API for behavior trees.

Includes a BehaviorTree class, which inherits from Plan, a nested Node class, which represents the nodes of the tree, and various children classes of Node for each type of supported BT node. The BehaviorTree includes a method to generate a Graphviz dot representation for it, a method to generate a proto of type behavior_tree_pb2, and a class method to initialize a new BehaviorTree from a BT proto object.

To execute the behavior tree, simply pass an instance of BehaviorTree to the executive.run() method.

Classes

class AllOf: A BehaviorTree condition encoding a boolean “and”.

class AnyOf: A BehaviorTree condition encoding a boolean “or”.

class BehaviorTree: Python wrapper around behavior_tree_pb2.BehaviorTree proto.

class Blackboard: A BT condition of type Blackboard.

class Branch: BT node of type Branch for behavior_tree_pb2.BehaviorTree.BranchNode.

class BreakpointType: Create a collection of name/value pairs.

class CompoundCondition: A base implementation for conditions composed of a number of conditions.

class Condition: Parent abstract base class for supported behavior tree conditions.

class Data: BT node of type Data for behavior_tree_pb2.DataNode.

class Debug: A BT node of type Debug for behavior_tree_pb2.BehaviorTree.DebugNode.

class Decorators: Collection of properties assigned to a node.

class DisabledResultState: Create a collection of name/value pairs.

class Fail: A BT node of type Fail for behavior_tree_pb2.BehaviorTree.FailNode.

class Fallback: BT node of type Fallback for behavior_tree_pb2.BehaviorTree.FallbackNode.

class IdRecorder: A visitor callable object that records tree ids and node ids.

class Loop: BT node of type Loop for behavior_tree_pb2.BehaviorTree.LoopNode.

class Node: Parent abstract base class for all the supported behavior tree nodes.

class NodeExecutionMode: Create a collection of name/value pairs.

class NodeIdentifierType: NodeIdentifierType(tree_id, node_id)

class NodeWithChildren: A parent class for any behavior tree node that has self.children.

class Not: A BT condition of type Not.

class Parallel: BT node of type Parallel for behavior_tree_pb2.BehaviorTree.ParallelNode.

class Retry: BT node of type Retry for behavior_tree_pb2.BehaviorTree.RetryNode.

class Selector: BT node of type Selector for behavior_tree_pb2.BehaviorTree.SelectorNode.

class Sequence: A BT node of type Sequence.

class SubTree: A BT node of type SubTree for behavior_tree_pb2.SubTreeNode.

class SubTreeCondition: A BT condition of type SubTree.

class Task: A BT node of type Task for behavior_tree_pb2.TaskNode.

class WorldQuery: Wrapper for WorldQuery proto for easier construction and conversion.

Type Aliases

WorldQueryObject