A published topic is a Skill: a client writes the fields, then starts the publishing.
The message fields are the Skill's Parameters, writable in any state, and nothing goes out while they are written. Start reads them, builds the message and publishes it: the first tick of a stream on a continuous Skill, the only publish on a finite one. Halt closes a stream. Reset clears the failure count and leaves the Parameters alone. There is no Suspend (opensmi keeps running the handler through SUSPENDING, so a paused stream would go on publishing) and no Monitoring sibling: the echo of a topic we publish is our own message, so a readback would only confirm the last value published. A consumer who wants to see the topic declares a MonitoringBinding on it. There is no FinalResultData either (it is optional in the SkillSet model), since a publish has no result.
The trigger is the tick alone: there is no debounce, coalescing or dirty tracking. A finite push has one publish, so any failure halts. A stream absorbs tolerated_failures consecutive ones, and every failure fires a BindingEvent whether it was absorbed or not.
opensmi leaves a continuous Skill in Running when its handler returns, so the rate loop never
returns: every exit raises an OpenSmiRuntimeError, which halts the Skill and reaches the
Component's Notification with its code. A stream exits when its tolerance for failed publishes is
spent, when the Lock it was started under ends (LOCK_ENDED), and when a declared
stale_after passes without a write (SETPOINT_STALE), each with a BindingEvent of the same
code. Halt cancels the handler instead.
Access is a Skill's like any other: Start, Halt and Reset need the Skill level
(skill_access_level) and the Machine's Lock, and Start also needs a completed startup. The
ParameterSet is built in opensmi.ros2.server.containers; the header stamp and the send-time
value guard are in opensmi.ros2.runtime.publisher.
| Class | |
The stream: one publish per tick of the rate Parameter, until Halt or nobody is in charge. |
| Class | |
The one-shot push: publish once on Start, then reach Completed. |
| Class | |
What both publishing Skills share, everything except the tick. |
| Function | binding |
Return the BindingEvent emitter of the machinery item that declared a Binding. |
| Function | default |
Build the message to publish out of what a client wrote into a Skill's Parameters. |
| Function | halt |
Build the message a stream publishes once when it ends, or None when none is declared. |
| Constant | LOCK |
The BindingEvent Code and ErrorCode of a stream halted because the Lock it was started under ended: released, broken, expired, or lost with the holder's session. |
| Constant | MAXIMUM |
The fastest publish rate, in hertz: the 1 ms period is the floor asyncio.sleep can keep. |
| Constant | MESSAGE |
The ErrorCode of a tick whose Parameters could not be built into a message. |
| Constant | MINIMUM |
The slowest publish rate a declaration or a client may set, in hertz (one tick every 16 minutes). |
| Constant | PUBLISH |
The BindingEvent Code of every failed publish, and the ErrorCode of the error that halts the Skill once its tolerance is spent. A TF Binding's failed broadcast reports under it too. |
| Constant | PUBLISH |
The faults that mean this tick did not reach the topic: the middleware refused the message, or the guard refused a field value. Any other Runtime error (a released publisher, a stopped Runtime) cannot be mended by another tick and is not tolerated. |
| Constant | RATE |
The browse name of the one Parameter of a continuous publishing Skill that is not a message field. |
| Constant | SETPOINT |
The BindingEvent Code and ErrorCode of a stream halted because no client wrote any of its Parameters within the Binding's stale_after. |
| Exception | _ |
A halt message table that does not fit its message type, with the field path at fault. |
| Function | _element |
Return one scalar or one element of a list, a nested element built from its own default. |
| Function | _field |
Return what one field of a halt message holds, given what the table says for it. |
| Function | _overlaid |
Return a message with the fields a table names set to its values, the rest left as they are. |
| Function | _require |
Refuse a continuous declaration whose message already claims the rate Parameter's name. |
| Constant | _FLOATING |
Undocumented |
object, message: str) -> Callable[ ..., Awaitable[ None]]:
¶
Return the BindingEvent emitter of the machinery item that declared a Binding.
Resolved at init so that a missing reporting surface is not first noticed by a report going nowhere. A Binding is only built by a Component that mixes ours in, so this is unreachable through the declarative API.
| Parameters | |
machineryobject | Undocumented |
message:str | The error text for a machinery item that cannot raise one. |
| Returns | |
Callable[ | Undocumented |
| Raises | |
DeclarationError | When the machinery item has no BindingEvent emitter. |
type[ Message], values: Mapping[ str, object], context: ProjectionContext) -> Message:
¶
Build the message to publish out of what a client wrote into a Skill's Parameters.
This runs the Projection of the message type backwards, as an action's goal and a service's request do. It is a pure function (no server, no rclpy, no event loop). Values the message has no field for, such as the reserved rate, are ignored.
| Raises | |
NotInvertibleError | When a field of the message has no value, because the selection removed it or no Parameter carries it. A default is never invented. |
PublisherBinding, message_type: type[ Message], runtime: RuntimeInterface) -> Message | None:
¶
Build the message a stream publishes once when it ends, or None when none is declared.
It starts from the message as the type's generated class constructs it, so a field the table does not name keeps that class's default, and sets the named fields. A number goes into a floating-point field as a float, so z = -1 in a file is -1.0. The result passes the same send-time guard as every message the Skill publishes, so a value the field cannot hold fails here, at init, and not on the robot.
| Raises | |
DeclarationError | When the table names a field the message type does not have, gives a table where a value belongs or the reverse, or holds a value its field cannot carry. |
The BindingEvent Code and ErrorCode of a stream halted because the Lock it was started under ended: released, broken, expired, or lost with the holder's session.
| Value |
|
The fastest publish rate, in hertz: the 1 ms period is the floor asyncio.sleep can keep.
| Value |
|
The ErrorCode of a tick whose Parameters could not be built into a message.
It halts the Skill and nothing is published; the error message names the field and the reason.
| Value |
|
The slowest publish rate a declaration or a client may set, in hertz (one tick every 16 minutes).
The bound is published as an EURange on the Parameter, so a write of zero is refused before a period is divided by it.
| Value |
|
The BindingEvent Code of every failed publish, and the ErrorCode of the error that halts the Skill once its tolerance is spent. A TF Binding's failed broadcast reports under it too.
| Value |
|
The faults that mean this tick did not reach the topic: the middleware refused the message, or the guard refused a field value. Any other Runtime error (a released publisher, a stopped Runtime) cannot be mended by another tick and is not tolerated.
| Value |
|
The browse name of the one Parameter of a continuous publishing Skill that is not a message field.
It is reserved: a message with a field that converts to it (rate) is refused at init. Its DisplayName is rate.
| Value |
|
The BindingEvent Code and ErrorCode of a stream halted because no client wrote any of its Parameters within the Binding's stale_after.
| Value |
|
ElementType, nested: type[ Message] | None, value: object, runtime: RuntimeInterface, path: str) -> object:
¶
Return one scalar or one element of a list, a nested element built from its own default.
FieldType, nested: type[ Message] | None, current: object, value: object, runtime: RuntimeInterface, path: str) -> object:
¶
Return what one field of a halt message holds, given what the table says for it.
Message, table: Mapping[ str, object], runtime: RuntimeInterface, where: str) -> Message:
¶
Return a message with the fields a table names set to its values, the rest left as they are.
tuple[ PlanEntry, ...], message_type: type[ Message], binding: PublisherBinding):
¶
Refuse a continuous declaration whose message already claims the rate Parameter's name.
Checked against the plan, not the message's fields, because a curated Projection chooses its own names and those are what collide. A finite Skill has no rate node, so it is not checked.
| Raises | |
DeclarationError | When the plan has a top-level entry called rate. |