class ROS2StartupSkill(BaseStartupSkill):
Constructor: ROS2StartupSkill(minimum_access_level, **kwargs)
The StartupSkill this package gives a machinery item that has not got a narrower one.
It stays Running once started. It waits for this item's required Bindings through the gate
and starts each child's StartupSkill and waits for it to run, because opensmi's own starting
handler stops at the first child that did not come up. A Machine gets one unless it
registers its own. A Component gets one when it declares a required Binding, and
opensmi.ros2.server.startup.ROS2LifecycleStartupSkill when it declares a lifecycle one.
It is not suspendable, because opensmi's StartupSkill never is.
| Method | __init__ |
Take the access level and hand opensmi the rest; the gate is built once there is a parent. |
| Async Method | close |
Release everything this Skill holds outside the state machine. Idempotent. |
| Property | gate |
Return the required Bindings this Skill answers for, as the gate that waits on them. |
| Async Method | _bring |
Bring one child's StartupSkill to Running, and say why if it did not get there. |
| Method | _children |
Return the child machinery items that have a StartupSkill of their own, in order. |
| Method | _deadline |
Return how long this Skill waits for one child: its longest required deadline plus startup_timeout. |
| Async Method | _handle |
Stop answering for the prerequisites, then halt the Components and the other Skills. |
| Async Method | _handle |
Do nothing: a started StartupSkill has nothing left to tick. |
| Async Method | _handle |
Wait for this item's prerequisites, command its own robot, then bring its children up. |
| Async Method | _init |
Let opensmi build the Skill, then resolve what its item declared required. |
| Async Method | _reach |
Fire one trigger at another Skill and watch until it settles, wherever that is. |
| Async Method | _reset |
Run opensmi's own starting handler, without letting one child be the verdict. |
| Async Method | _start |
Start every child's StartupSkill and wait for it to reach Running. |
| Async Method | _start |
Command whatever this item owns on the ROS2 side. The lifecycle Skill activates its nodes here. |
| Instance Variable | _fired |
Undocumented |
| Instance Variable | _handle |
Undocumented |
| Instance Variable | _startup |
Undocumented |
Take the access level and hand opensmi the rest; the gate is built once there is a parent.
The default is the ROS2 settings' skill_access_level default, not opensmi's 2, because the orchestrator must be able to start a machine with no operator present.
| Parameters | |
minimumint | The level Start, Halt and Reset need. |
**kwargs:Any | Undocumented |
Release everything this Skill holds outside the state machine. Idempotent.
The declaring item's shutdown calls it; a subclass that holds more releases it here and calls up. opensmi's supervision task is stopped too, since it has no shutdown of its own and would fail on nodes that are gone.
Bring one child's StartupSkill to Running, and say why if it did not get there.
Each step is skipped where it has already happened, since resetting a running Component would tear down a working robot.
| Returns | |
str | None | None when the child is running, or a phrase naming it and where it stopped. |
Stop answering for the prerequisites, then halt the Components and the other Skills.
This is opensmi's own halting handler, minus this Skill. opensmi's halt_skills waits for every Skill of the item to be Halted and has not got an exception for the caller, so called from here it would wait for the halt it is part of and fail after its timeout.
Wait for this item's prerequisites, command its own robot, then bring its children up.
The prerequisites come first: a managed node that is not on the graph cannot be activated, and the Skill should report that it is waiting for the node, not that the node did not answer. Each child waits for its own prerequisites in its own handler.
Let opensmi build the Skill, then resolve what its item declared required.
| Raises | |
DeclarationError | When the item declares a required Binding and cannot raise a BindingEvent. |
Any, target: SkillState, deadline: float, trigger: Any, label: str):
¶
Fire one trigger at another Skill and watch until it settles, wherever that is.
The trigger is fired from a task of its own and watched, not awaited: AsyncMachine cancels the tasks processing a transition when the next one for that model begins and swallows the CancelledError. opensmi's wait_for_state is not used, because it raises on Halted only if the Skill was not already there, so a child that halted early would be reported as a timeout. The caller reads CurrentState for the verdict.
Run opensmi's own starting handler, without letting one child be the verdict.
Its reset raises at the first Component that halted. That is swallowed here, because
_start_children names every child that did not come up, and the rest of opensmi's
housekeeping still has to run.
Start every child's StartupSkill and wait for it to reach Running.
| Raises | |
OpenSmiRuntimeError | When any child's StartupSkill did not reach Running,
carrying COMPONENT_NOT_RUNNING and naming every one of them. |