module documentation

The StartupSkill a lifecycle node drives, and that drives the lifecycle node back.

The Binding is the StartupSkill. It derives from BaseStartupSkill, which carries opensmi's status supervision. Reset configures every node that is not configured yet (Halted to Ready is unconfigured to inactive) and is refused while any node is Terminal. Start activates every node that is not active. Running means every node is active, and nothing ticks there. Halt takes back what this Skill did: deactivate for a node it activated, cleanup for one it configured, never shutdown (finalized is terminal, so the Skill could never be reset), and nodes that were already active are left as found. The Skill is not suspendable, because opensmi's BaseStartupSkill is not.

Following is downward only. A transition somebody else caused moves the Skill toward what the nodes say and stops where the client has taken it: an external cleanup or deactivate halts the Skill, an external activate does not start it. Recovery is the operator's Reset and Start. Handlers command whoever fired the trigger, so a Skill halted by one external cleanup also takes back the other nodes it brought up. This is safe because a Driver sends nothing to a node that is already where the trigger wants it, which makes every handler idempotent. Transitions that arrive while a handler is commanding are its own: they are recorded and move nothing, and one settle runs when the handler is done.

The state correspondence is in opensmi.ros2.server.lifecycle, the services in opensmi.ros2.server.drivers. A refused transition has no BindingEvent: opensmi's failure path reports it with TRANSITION_REFUSED.

Class ROS2LifecycleStartupSkill One Component's lifecycle declarations, as the StartupSkill they all land on.
Constant EXTERNALLY_MOVED What a lifecycle Binding reports when something other than us moved one of its nodes.
Constant SETTLE_INTERVAL Seconds an observation waits when the Skill is mid-transition and cannot act on it yet.
Constant STATE_VARIABLE The leaf under which every node's lifecycle state is published in the StartupSkill's Monitoring.
Constant TERMINAL What a lifecycle Binding reports when one of its nodes reaches finalized.
Constant TRANSITION_REFUSED The error code a halt carries when a node or a manager would not take a transition.
Constant UNKNOWN_STATE What a node's state variable holds before anything has been heard from that node.
Function _driver_for Return the Driver one declaration asked for: its own class, or the flavour it named.
Function _require_nothing_refused Halt the Skill when anything refused a transition, naming every cause.
Function _require_one_owner_per_node Return which declaration owns each node path.
EXTERNALLY_MOVED: str =

What a lifecycle Binding reports when something other than us moved one of its nodes.

CurrentState says where the Skill ended up, this says that nobody asked for it. A warning, since an ordinary robot doing an ordinary thing causes it.

Value
'EXTERNALLY_MOVED'
SETTLE_INTERVAL: float =

Seconds an observation waits when the Skill is mid-transition and cannot act on it yet.

Neither state machine has a completion callback, so a held observation is re-offered at this interval. It runs only while something is pending and polls the Skill, never ROS2.

Value
0.1
STATE_VARIABLE: str =

The leaf under which every node's lifecycle state is published in the StartupSkill's Monitoring.

A variable browses as <Binding>/<node path>/State, one grouping Object per segment of the node path, with state as its DisplayName. finalized is an ordinary Good value, since the node is answering.

Value
'state'
TERMINAL: str =

What a lifecycle Binding reports when one of its nodes reaches finalized.

Refusing Reset leaves CurrentState looking like an ordinary, resettable Halted, so without this event a client learns only by trying. Fired once per node per latch; the latch lifts when a non-terminal state is observed on that node's path.

Value
'TERMINAL'
TRANSITION_REFUSED: str =

The error code a halt carries when a node or a manager would not take a transition.

It is the code on opensmi's own error message, which joins every fault of one trigger into one text on this Skill's Notification. There is no BindingEvent beside it.

Value
'TRANSITION_REFUSED'
UNKNOWN_STATE: str =

What a node's state variable holds before anything has been heard from that node.

Value
'unknown'
def _driver_for(binding: LifecycleBinding, runtime: RuntimeInterface) -> LifecycleDriver:

Return the Driver one declaration asked for: its own class, or the flavour it named.

def _require_nothing_refused(faults: Sequence[str], trigger: str):

Halt the Skill when anything refused a transition, naming every cause.

Raises
OpenSmiRuntimeErrorWhen there is at least one fault.
def _require_one_owner_per_node(drivers: Sequence[LifecycleDriver]) -> dict[str, LifecycleBinding]:

Return which declaration owns each node path.

Raises
DeclarationErrorWhen one node path appears under two declarations.