class documentation

class LifecycleBinding(AwaitedBinding):

View In Hierarchy

A ROS2 lifecycle node driving the declaring Component's StartupSkill.

A managed node's state machine and the continuous-skill state machine are the same, so this lands on the StartupSkill opensmi already has. Halted, Ready and Running are unconfigured, inactive and active. The triggers reset, start and halt send configure, activate and deactivate then cleanup. halt is never shutdown, because finalized is terminal and the Skill could not be Reset. There is no suspend, since the StartupSkill is not suspendable.

The Binding is two-way. Transitions somebody else caused move the Skill, downward only, because starting is a client-driven contract. Several of these on one Component drive the one StartupSkill, with a lowest-wins aggregate: Running means every node is active.

The coordinator flavour is a ~opensmi.ros2.server.drivers.LifecycleDriver (the standard lifecycle_msgs services, or a nav2-style manager), and the OPC UA surface is the same for each.

Method __post_init__ Refuse a declaration that names a coordinator that cannot be built.
Class Variable kind Undocumented
Instance Variable call_timeout Seconds to wait for an answer once the request has gone.
Instance Variable depth The ROS2 queue depth of the transition_event subscription of each node.
Instance Variable driver The coordinator flavour: a name in ~opensmi.ros2.server.drivers.DRIVERS (lifecycle, the ROS2 standard, or nav2) or a subclass of ~opensmi.ros2.server.drivers.LifecycleDriver. A Binding file gives a name; a machine file can give a class as ...
Instance Variable name The Binding's name. It is not a Skill name (the Skill is the Component's StartupSkill); it keeps declarations apart, prefixes this Binding's variables and names the BindingEvent source.
Instance Variable nodes The lifecycle nodes observed and gated on, when path is a coordinator. Empty for the standard flavour; required (fatal at init if empty) for a flavour that coordinates a set.
Instance Variable path The ROS2 node this declaration commands through: the managed node itself for the standard flavour, the manager for a nav2-style one.
Instance Variable required Whether the StartupSkill waits for its nodes to be on the graph before Running. A managed node is present when it publishes transition_event, so a finalized node still counts.
Instance Variable server_timeout Seconds a question or command waits for the node's services before giving up on that attempt. A node that is off is a runtime condition and the next appearance looks again.
Instance Variable startup_timeout Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.
Property driver_class Return the Driver class driver selects, looking a name up in the registry.
Property needs_the_graph Return False; whether a node is there comes from transition_event match events.
Property observed Return the lifecycle nodes this Binding follows: nodes, or path when that is empty.
def __post_init__(self):

Refuse a declaration that names a coordinator that cannot be built.

Raises
ImplementationClassErrorWhen driver is a class that is not a LifecycleDriver subclass.
DeclarationErrorWhen driver names no registered flavour, or a flavour whose path is a coordinator is given no nodes to drive.
RequiredDeclarationErrorWhen startup_timeout is declared without required, or is not positive.
kind: ClassVar[str] =

Undocumented

call_timeout: float =

Seconds to wait for an answer once the request has gone.

depth: int =

The ROS2 queue depth of the transition_event subscription of each node.

driver: str | type =

The coordinator flavour: a name in ~opensmi.ros2.server.drivers.DRIVERS (lifecycle, the ROS2 standard, or nav2) or a subclass of ~opensmi.ros2.server.drivers.LifecycleDriver. A Binding file gives a name; a machine file can give a class as driver_type, by import path. Fatal at init when it is neither.

name =

The Binding's name. It is not a Skill name (the Skill is the Component's StartupSkill); it keeps declarations apart, prefixes this Binding's variables and names the BindingEvent source.

nodes: tuple[str, ...] =

The lifecycle nodes observed and gated on, when path is a coordinator. Empty for the standard flavour; required (fatal at init if empty) for a flavour that coordinates a set.

path: str =

The ROS2 node this declaration commands through: the managed node itself for the standard flavour, the manager for a nav2-style one.

required =

Whether the StartupSkill waits for its nodes to be on the graph before Running. A managed node is present when it publishes transition_event, so a finalized node still counts.

server_timeout: float =

Seconds a question or command waits for the node's services before giving up on that attempt. A node that is off is a runtime condition and the next appearance looks again.

startup_timeout =

Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.

@property
driver_class: type =

Return the Driver class driver selects, looking a name up in the registry.

@property
needs_the_graph: bool =

Return False; whether a node is there comes from transition_event match events.

@property
observed: tuple[str, ...] =

Return the lifecycle nodes this Binding follows: nodes, or path when that is empty.