intrinsic.solutions.behavior_tree.Data
![]() View source on GitHub |
BT node of type Data for behavior_tree_pb2.DataNode.
Inherits From: Node
intrinsic.solutions.behavior_tree.Data(
*,
blackboard_key: str = '',
operation: 'Data.OperationType' = intrinsic.solutions.behavior_tree.Data.OperationType.CREATE_OR_UPDATE,
cel_expression: Optional[str] = None,
world_query: Optional[intrinsic.solutions.behavior_tree.WorldQuery] = None,
proto: Optional[protobuf_message.Message] = None,
protos: Optional[List[protobuf_message.Message]] = None,
name: Optional[str] = None
)
A data node can be used to create, update, or remove data from the blackboard. Information stored there can be created by a CEL expression, a specific proto or a list of protos, or from a world query.
Attributes | |
|---|---|
blackboard key the node operates on | |
CEL expression for create or update operation | |
World query for create or update operation | |
Proto for create or update operation | |
Protos for create or update operation | |
describing the operation the data node will perform | |
The proto representation of the node. | |
A string label of the node type. | |
blackboard value to pass on the modified blackboard key. | |
Child Classes
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 this node suitable for inclusion in a dot graph.
| Args | |
|---|---|
| A little string of form |
| Returns | |
|---|---|
Dot graph representation for this 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_blackboard_key
View source
set_blackboard_key(
blackboard_key: str
) -> 'Data'
Sets the blackboard key for this operation.
| Args | |
|---|---|
| blackboard key by which the value can be accessed in other nodes. |
| Returns | |
|---|---|
self (for builder pattern) |
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_cel_expression
View source
set_cel_expression(
cel_expression: str
) -> 'Data'
Sets the CEL expression to create or update a blackboard value.
| Args | |
|---|---|
| CEL expression that may reference other blackboard values. |
| Returns | |
|---|---|
self (for builder pattern) |
set_decorators
View source
set_decorators(
decorators: Optional['Decorators']
) -> 'Node'
Sets decorators for this node.
set_input_proto
View source
set_input_proto(
proto: protobuf_message.Message
) -> 'Data'
Sets a specific proto for creating or updating a blackboard value.
| Args | |
|---|---|
| The proto to store in the blackboard |
| Returns | |
|---|---|
self (for builder pattern) |
set_input_protos
View source
set_input_protos(
protos: List[protobuf_message.Message]
) -> 'Data'
Sets list of specific protos for creating or updating a blackboard value.
| Args | |
|---|---|
| The protos to store in the blackboard (will be wrapped in an intrinsic_proto.executive.AnyList. |
| Returns | |
|---|---|
self (for builder pattern) |
set_operation
View source
set_operation(
operation: intrinsic.solutions.behavior_tree.Data.OperationType
) -> 'Data'
Sets the mode of the performed operation.
| Args | |
|---|---|
| operation to perform, see enum. |
| Returns | |
|---|---|
self (for builder pattern) |
set_world_query
View source
set_world_query(
world_query: intrinsic.solutions.behavior_tree.WorldQuery
) -> 'Data'
show
View source
show() -> None
validate
View source
validate() -> None
Validates the current input.
This checks if one and only one input is set for the Data node.
| Raises | |
|---|---|
| raised if the node is in a state that could not be converted to a valid proto. |
visit
View source
visit(
containing_tree: 'BehaviorTree',
callback: Callable[['BehaviorTree', Union['BehaviorTree', 'Node', 'Condition']], None]
) -> None