intrinsic.solutions.behavior_tree.Retry
![]() View source on GitHub |
BT node of type Retry for behavior_tree_pb2.BehaviorTree.RetryNode.
Inherits From: Node
intrinsic.solutions.behavior_tree.Retry(
max_tries: int = 0,
child: Optional[Union['Node', actions.ActionBase]] = None,
recovery: Optional[Union['Node', actions.ActionBase]] = None,
name: Optional[str] = None,
retry_counter_key: Optional[str] = None
)
Runs the child node and retries if the child fails. After the given number of retries, the failure gets propagated up.
Attributes | |
|---|---|
The child node of this node that is to be retried upon failure. | |
An optional sub-tree that is executed if the child fails and there are still tries left to be performed. If the recovery fails, the retry node will fail immediately irrespective of the number of tries left. | |
Maximal number of times to execute the child before propagating the failure up. | |
The proto representation of the node. | |
A string label of the node type. | |
The key to access the retry counter on the blackboard, only available while inside the retry node. | |
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]
Generates a graphviz subgraph with a single node for self.
| Args | |
|---|---|
| A little string of form |
| The label is typically just the type of the node. To use a different value, this argument can be used. |
| name of the node as set by the user. |
| Returns | |
|---|---|
A tuple of the generated graphviz dot graph and the name of the graph'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_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_child
View source
set_child(
child: Union['Node', actions.ActionBase]
) -> 'Retry'
set_decorators
View source
set_decorators(
decorators: Optional['Decorators']
) -> 'Node'
set_recovery
View source
set_recovery(
recovery: Union['Node', actions.ActionBase]
) -> 'Retry'
show
View source
show() -> None
visit
View source
visit(
containing_tree: 'BehaviorTree',
callback: Callable[['BehaviorTree', Union['BehaviorTree', 'Node', 'Condition']], None]
) -> None