intrinsic.solutions.behavior_tree.SubTree
![]() View source on GitHub |
A BT node of type SubTree for behavior_tree_pb2.SubTreeNode.
Inherits From: Node
intrinsic.solutions.behavior_tree.SubTree(
behavior_tree: Optional[Union['Node', 'BehaviorTree']] = None,
name: Optional[str] = None
)
This node is usually used to group components into a subtree.
Args | |
|---|---|
behavior tree or root node of a tree for this subtree. If passing a root node you must also provide the name argument. | |
name of the behavior tree, if behavior_tree is a node, i.e., a root node of a tree; otherwise, the name of this node. | |
Attributes | |
|---|---|
The subtree, a BehaviorTree object. | |
The name of the subtree node. | |
The proto representation of the node. | |
A string label of the node type. | |
Methods
create_from_proto
View source
@classmethodcreate_from_proto( proto_object: behavior_tree_pb2.BehaviorTree.Node ) -> 'Node'
Instantiates a Node instance from a proto.
disable_execution
View source
disable_execution(
result_state: Optional[intrinsic.solutions.behavior_tree.DisabledResultState] = None
) -> 'Node'
Disables a node, so that it is not executed and appears to be skipped.
| Args | |
|---|---|
| Optionally force the result of the execution to this state. If not set, the resulting state is automatically determined, so that the node is skipped. |
| Returns | |
|---|---|
Builder pattern, returns self. |
dot_graph
View source
dot_graph(
node_id_suffix: str = ''
) -> Tuple[graphviz.Digraph, str]
Converts the given subtree into a graphviz dot graph.
The edge goes from parent to the root node of the subtree.
| Args | |
|---|---|
| A little string with the suffix to make the given node unique in the dot graph. |
| Returns | |
|---|---|
A tuple of graphviz dot graph representation of the full subtree and the name of the subtree's root node. |
enable_execution
View source
enable_execution() -> 'Node'
Enables a node, so that it will be executed.
| Returns | |
|---|---|
Builder pattern, returns self. |
generate_and_set_unique_id
View source
generate_and_set_unique_id() -> int
Generates a new random id and sets it for this node.
set_behavior_tree
View source
set_behavior_tree(
behavior_tree: Union['Node', 'BehaviorTree'], name: Optional[str] = None
) -> 'SubTree'
Sets the subtree's behavior tree.
| Args | |
|---|---|
| behavior tree or root node of a tree for this subtree. If passing a root node you must also provide the name argument. |
| name of the behavior tree, if behavior_tree is a node, i.e., a root node of a tree; otherwise, the name of this node. |
| Returns | |
|---|---|
self for chaining. |
set_breakpoint
View source
set_breakpoint(
breakpoint_type: Optional['BreakpointType']
) -> 'Node'
Sets the breakpoint type on the decorator.
| Args | |
|---|---|
| desired breakpoint type, None to remove type. |
| Returns | |
|---|---|
Builder pattern, returns self. |
set_decorators
View source
set_decorators(
decorators: Optional['Decorators']
) -> 'Node'
show
View source
show() -> None
visit
View source
visit(
containing_tree: 'BehaviorTree',
callback: Callable[['BehaviorTree', Union['BehaviorTree', 'Node', 'Condition']], None]
) -> None