Required Bindings: the StartupSkill's contract, and what a client sees at startup.
A Binding marked required=True means that the StartupSkill of the machinery item that declared
it does not reach Running until the Binding is Satisfied, which means its ROS2 counterpart is
present. If its deadline passes first, the Skill halts and opensmi's own supervision reports the
Machine OutOfService. Satisfied is presence, never first data: a publisher that has
not spoken satisfies a Binding. satisfaction_of holds the answer per kind, and both the
StartupSkill and the introspection Component's provenance report use it, so they cannot disagree.
Nothing waits before the endpoint opens. Every _init creates its nodes and returns, and the wait
happens inside _handle_starting, so the Skill is observably Starting meanwhile. The Machine
and Component mixins add ROS2StartupSkill themselves, because opensmi does not require a
StartupSkill; its starting handler waits for the declarations first and asks every child for its
verdict instead of stopping at the first.
Every Binding fires REQUIRED_BINDING_ABSENT at its own deadline, and the halt at the last
one names every Binding that missed. A Binding lost after startup is reported
(REQUIRED_BINDING_LOST) but never halts, so a restarted sensor node cannot tear a robot down
mid-goal; recovery is Reset plus Start, and the check re-runs on every start. A normal boot
is quiet: no event when a Binding becomes satisfied, and none about a Binding that is not required.
The satisfaction facts are polled every CHECK_INTERVAL seconds, since the kinds learn
presence in different ways and share no event stream.
| Class | |
One required Binding, as the wait sees it: a deadline and a question to ask. |
| Class | |
The StartupSkill this package gives a machinery item that has not got a narrower one. |
| Class | |
One machinery item's required Bindings, as the wait and the watch that follow from them. |
| Async Function | close |
Release every StartupSkill of ours on one machinery item. Idempotent. |
| Function | prerequisites |
Return what one machinery item's StartupSkill waits for, one entry per required Binding. |
| Function | satisfaction |
Return how to ask whether one Binding is Satisfied, or None when the word does not apply. |
| Async Function | wait |
Wait until every prerequisite is Satisfied or its own deadline has passed. |
| Constant | CHECK |
Seconds between two readings of anything a starting StartupSkill is waiting on. |
| Constant | COMPONENT |
The error code a Machine's halt carries when a Component's StartupSkill did not come up. |
| Constant | LOSS |
Seconds between two readings of whether a Binding is still Satisfied, once nothing waits on it. |
| Constant | REQUIRED |
What a required Binding reports when its own deadline passed and it was still not Satisfied. |
| Constant | REQUIRED |
What a required Binding reports when it was Satisfied after startup and then was not. |
| Function | _deployment |
Return the default deadline of the deployment one machinery item is part of. |
| Function | _every |
Return whether every ROS2 parameter one declaration names is confirmed on its node. |
| Function | _every |
Return whether every node one lifecycle declaration follows is on the graph. |
| Function | _graph |
Return the Runtime's last graph snapshot, or an empty one without a Runtime. |
| Function | _prerequisite |
Return one declaration as the wait sees it, with the probe its kind answers through. |
| Function | _reads |
Return whether a kind's presence is read off the graph snapshot, which has to be watched. |
| Function | _verdict |
Return the fault text of a startup that ran out of time, naming every cause. |
Release every StartupSkill of ours on one machinery item. Idempotent.
A Machine's and a Component's shutdown both call it, to release the watch behind a required Binding and the lifecycle Skill's subscriptions.
Return what one machinery item's StartupSkill waits for, one entry per required Binding.
| Parameters | |
machineryAny | The Component or Machine whose declarations these are. One without Bindings, such as every Machine, answers with nothing. |
| Returns | |
tuple[ | Undocumented |
| Raises | |
DeclarationError | When a required Binding's kind has no answer to what Satisfied means for it. |
Return how to ask whether one Binding is Satisfied, or None when the word does not apply.
Nothing is asked here, so this works while the Component is still being built. None means the kind has no presence to read, as with a publishing Binding (we are the publisher). The probe reads through getattr, so an item that is not one of ours answers absent.
| Monitoring | The subscription's publisher count, off its DDS match events. A Binding that is not bound yet is not satisfied. |
| Keyed | The subscription's publisher count, never membership. |
| Method | The service is on the Runtime's last graph snapshot. This reads the snapshot and starts no poll, so it answers absent where nothing watches the graph; the StartupSkill's wait holds a watch open while it asks. |
| ROS2 parameter | Every declared name is confirmed present on the node, read off the parameter mirror. |
| Action | The action is on the Runtime's last graph snapshot, like a service. |
| Lifecycle | A publisher on each declared node's transition_event. |
| TF | Something other than this server publishes on a transform topic, never a particular frame. |
Sequence[ Prerequisite], *, report: Callable[ [ Prerequisite], Awaitable[ None]], interval: float = CHECK_INTERVAL) -> tuple[ Prerequisite, ...]:
¶
Wait until every prerequisite is Satisfied or its own deadline has passed.
There is no fail-fast and no shared deadline. A prerequisite that misses its deadline is reported at once and counted as missed, even if it arrives later. A prerequisite that is met is dropped and not asked again; if it goes away later, the gate's watch reports it as lost.
| Parameters | |
prerequisites:Sequence[ | What to wait for. Empty returns at once. |
report:Callable[ | How to announce one that missed its deadline, awaited at that deadline. |
interval:float | Seconds between two readings. |
| Returns | |
tuple[ | The prerequisites that missed their deadlines, in the order they did. Empty means the wait was met. |
Seconds between two readings of anything a starting StartupSkill is waiting on.
That is the satisfaction facts and a child Skill's CurrentState. It is the granularity of "the robot came up" for a client watching CurrentState; each Binding's deadline is its own.
| Value |
|
The error code a Machine's halt carries when a Component's StartupSkill did not come up.
It is not a BindingEvent, since its subject is a Component. The fault text names every Component that did not reach Running.
| Value |
|
Seconds between two readings of whether a Binding is still Satisfied, once nothing waits on it.
| Value |
|
What a required Binding reports when its own deadline passed and it was still not Satisfied.
One event per Binding, at its own deadline. It is also the error code the halt carries on opensmi's own Notification.
| Value |
|
What a required Binding reports when it was Satisfied after startup and then was not.
A warning, since nothing is halted. Reported once per loss: a sensor that flaps twice is reported twice. Coming back is not reported.
| Value |
|
Return the default deadline of the deployment one machinery item is part of.
An item outside a Machine of ours gets the ~opensmi.ros2.server.config.ROS2Config
default.
Return whether every ROS2 parameter one declaration names is confirmed on its node.
A Binding whose mirror is not built yet (a Component mid-init) answers with its node path, so it is not satisfied.
Return whether every node one lifecycle declaration follows is on the graph.
Asked of the Component's own StartupSkill, which follows the nodes.
Return one declaration as the wait sees it, with the probe its kind answers through.
| Raises | |
DeclarationError | When the Binding is required and its kind has no answer to what Satisfied means for it. |