py_trees.demos.ports.xml_tree module

Parse and run a behaviour tree from XML with remapping and subtrees.

class py_trees.demos.ports.xml_tree.AddSuffix(name: str, **kwargs: Any)

Bases: BehaviourWithPorts

Append a configurable suffix to an input string.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

update() Status

Append suffix to input and write the result to output.

class py_trees.demos.ports.xml_tree.GreetingProducer(name: str, **kwargs: Any)

Bases: BehaviourWithPorts

Produce a greeting string.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

update() Status

Write a fixed greeting to the output port.

class py_trees.demos.ports.xml_tree.PrintConsumer(name: str, **kwargs: Any)

Bases: BehaviourWithPorts

Capture the final value for display.

property consumed_value: str

Return the value wired to this node’s input port.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

update() Status

Return SUCCESS; the value is read via consumed_value.

py_trees.demos.ports.xml_tree.main() None

Parse XML, tick the tree once, and print the consumed final message.