An action is a finite Skill: a client starts it, watches it, and reads what it produced.
| Start | Read the Parameters, build the goal, send it. Running is reached only once the server has accepted the goal. |
| Running | Feedback is written to Monitoring as it arrives; the goal's ending is awaited. |
| Completed | The goal succeeded. The result fields are in FinalResultData. |
| Halt | Cancel the goal. An aborted or externally cancelled goal also ends here. |
| Reset | Clear Monitoring and FinalResultData. The Parameters are left alone, so a goal a client wrote before Reset is not discarded silently. |
| Suspend | Not available: ROS2 actions cannot be paused, so the Skill is never suspendable and opensmi removes the method. |
The outcome drives the state machine: Completed is success and Halted is every other
ending. FinalResultData holds only the fields of the result message. Three outcome booleans
(succeeded, aborted, canceled) can be added as a debugging aid with
~opensmi.ros2.server.config.ROS2Config.debug_goal_outcome_booleans.
opensmi runs the state machine and the _handle_* methods below are its hooks. Start,
Halt and Reset need the Skill access level (skill_access_level, default
~opensmi.ros2.server.access.SKILL_ACCESS_LEVEL) and the Machine's Lock; Start also needs
a completed startup. An OpenSmiRuntimeError from a handler halts the Skill and appears as a
runtime error in the Notification of the Component, with its code as ErrorCode. Any other
exception and a cancelled handler halt it too.
default_goal_from and default_result_to are pure functions of a message and its
Projection context. A declaration may name its own pair; a replacement that needs the instance
overrides ROS2ActionSkill.build_goal or ROS2ActionSkill.result_values on a custom
class. The containers themselves are built in opensmi.ros2.server.containers.
| Class | |
The finite Skill one ~opensmi.ros2.server.bindings.ActionBinding becomes. |
| Function | default |
Build a goal message out of what a client wrote into a Skill's Parameters. |
| Function | default |
Read a result message into the FinalResultData variables its type was shaped into. |
| Constant | GOAL |
The error code of a Start whose Parameters could not be built into a goal. |
| Constant | OUTCOME |
The three result booleans the opt-in debugging flag adds to FinalResultData. |
| Function | _fault |
Return what a halting Skill reports about a goal, out of that goal's own faults. |
type[ Message], values: Mapping[ str, object], context: ProjectionContext) -> Message:
¶
Build a goal message out of what a client wrote into a Skill's Parameters.
The Projection covering the goal type, run backwards. A pure function: no server, rclpy or event loop.
| Raises | |
NotInvertibleError | When a field of the goal has no value, because the selection removed it or no Parameter carries it. Such a field is refused instead of filled with a default. |
The error code of a Start whose Parameters could not be built into a goal.
The Skill halts and the goal never reaches ROS2. The error arrives in the Component's Notification with this code and a message naming the field and the reason.
| Value |
|
The three result booleans the opt-in debugging flag adds to FinalResultData.
They are derived from one outcome, so they cannot disagree with each other.
| Value |
|