py_trees.demos.ports.remapping module

Explicit 3-step pipeline with remapping and subtree namespaces.

class py_trees.demos.ports.remapping.AppendSuffix(name: str, suffix: str, **kwargs: Any)

Bases: BehaviourWithPorts

Step 2: read one string, append a suffix, and write the updated string.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

update() Status

Append the suffix and write both the processed text and a status string.

class py_trees.demos.ports.remapping.GenerateValue(name: str, prefix: str = 'value', **kwargs: Any)

Bases: BehaviourWithPorts

Step 1: generate a random value and write it to an output port.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

update() Status

Generate a random value and write it to the output port.

class py_trees.demos.ports.remapping.ReadResult(name: str, **kwargs: Any)

Bases: BehaviourWithPorts

Step 3: read the final pipeline value so it can be inspected.

classmethod input_ports() dict

Return the input port declarations.

classmethod output_ports() dict

Return the output port declarations.

property result: str

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

update() Status

Return SUCCESS; the value is read via result.

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

Run two isolated 3-step pipelines that reuse the same port names (no clash).

py_trees.demos.ports.remapping.run_pipeline(namespace: str, prefix: str, suffix: str) str

Run one explicit 3-step pipeline in the given namespace.

Step 1: GenerateValue writes to /step1_value.

Step 2: AppendSuffix reads /step1_value, writes /step2_value, and also writes a local (unremapped) value status output.

Step 3: ReadResult reads /step2_value.