Drivers: which service, which encoding, which topic, and no state machine.
A Driver is the part of a lifecycle Binding that knows how one flavour of coordinator is commanded.
The mapping onto Skill states is shared and lives in opensmi.ros2.server.lifecycle, so
Components driven by different Drivers present the same OPC UA surface. Two ship:
StandardLifecycleDriveris the ROS2 standard, lifecycle_msgs, one node at a time via <node>/change_state.Nav2ManagerDriveris a nav2-style coordinator that drives a set of nodes with one <manager>/manage_nodes call.
Observing is common to both, because a nav2-managed node is an ordinary lifecycle node. Every
Driver gates each transition on what the node reports as available. An invalid change request kills
an rclpy node (Jazzy 7.1.11: the RCLError propagates out of rclpy.spin()), and a
finalized node offers nothing, so a node that does not offer a transition is skipped. Discovery
uses each node's transition_event subscription (transitions and publisher matches) instead of
polling the graph. A third flavour subclasses LifecycleDriver, implements
~LifecycleDriver.send and is given as the Binding's driver.
Nothing here imports rclpy or touches OPC UA, so a Driver is tested with the fake Runtime.
| Class | |
One coordinator flavour, commanded and observed. Holds no state machine. |
| Class | |
A nav2-style manager: one manage_nodes call covering the whole set it drives. |
| Class | |
One transition a node announced: the node's path and its start and goal state ids. |
| Class | |
The ROS2 standard: lifecycle_msgs, one change_state call per node. |
| Constant | CHANGE |
The service type behind <node>/change_state, which only the standard flavour sends. |
| Constant | DRIVERS |
Which coordinator flavour a declaration's driver= selects. |
| Constant | GET |
The service type behind <node>/get_available_transitions, which is the gate. |
| Constant | GET |
The service type behind <node>/get_state: one query, answered by the node itself. |
| Constant | MANAGE |
The service type a nav2-style manager takes: one uint8 command covering a whole set. |
| Constant | NAV2 |
Which nav2 manager command sends which lifecycle transition at the set it drives. |
| Constant | TRANSITION |
The topic type every managed node announces its transitions on, whoever coordinates it. |
| Function | _as |
Return the lifecycle state one id names, or UNKNOWN for a number ROS2 has not defined. |
| Function | _state |
Return the id of one lifecycle_msgs/msg/State field, or UNKNOWN if it is missing. |
| Function | _state |
Return a readable name for one lifecycle state id, for a representation or a log line. |
The service type behind <node>/change_state, which only the standard flavour sends.
| Value |
|
Which coordinator flavour a declaration's driver= selects.
A fixed table, so that a Binding file chooses among these by name and cannot introduce a class.
A third flavour subclasses LifecycleDriver and is passed as the class.
| Value |
|
The service type behind <node>/get_available_transitions, which is the gate.
| Value |
|
The service type behind <node>/get_state: one query, answered by the node itself.
| Value |
|
The service type a nav2-style manager takes: one uint8 command covering a whole set.
Its interface package is nav2's, so naming this flavour without nav2 installed is fatal at init.
| Value |
|
Which nav2 manager command sends which lifecycle transition at the set it drives.
The numbers are spelled out because the constants live on a generated nav2 class that cannot be
imported without nav2. RESUME and PAUSE are the manager's words for activate and
deactivate. STARTUP and RESET are compounds already expressed in
opensmi.ros2.server.lifecycle.TRANSITIONS_FOR, and SHUTDOWN ends in finalized,
which this project never commands.
| Value |
|
The topic type every managed node announces its transitions on, whoever coordinates it.
| Value |
|
Return the id of one lifecycle_msgs/msg/State field, or UNKNOWN if it is missing.
UNKNOWN reads as no opinion instead of a traceback on a later task.