How a Skill and a Method build, write and clear their variable containers.
Mixed in ahead of opensmi's callable class. The annotated names below are what it expects to find on that class.
| Method | __init__ |
Pass every argument on to opensmi's callable. |
| Class Variable | callable |
What a refusal calls the owner, Skill or Method. |
| Property | logger |
Return the logger opensmi gives every object. |
| Property | name |
Return the callable's name, which is its Binding's. |
| Async Method | _create |
Render one plan in one container, and record it on it. |
| Method | _named |
Return how a refusal names one of these containers, from a reader's side. |
| Async Method | _read |
Read one container into the plan's values, by name. |
| Method | _report |
Log a decoded name its shape never created, and skip the value. |
| Async Method | _reset |
Put every variable of one container back to the plan's initial value. |
| Async Method | _write |
Write one value to a variable's node with the variant type the plan decided. |
| Async Method | _write |
Write a name-to-value map into one container, skipping names it has no variable for. |
Pass every argument on to opensmi's callable.
Only here for the type checker: without it super().__init__(name=...) in a Skill or Method resolves to this mixin and reports unknown keywords.
Sequence[ PlanEntry], container: VariableContainer, *, message_type: type[ Message], writable: bool = False):
¶
Render one plan in one container, and record it on it.
Every name is checked before any variable is made, so a failing plan leaves nothing half-built.
| Parameters | |
plan:Sequence[ | Undocumented |
container:VariableContainer | Undocumented |
messagetype[ | The ROS2 type the plan was shaped from. |
writable:bool | Undocumented |
| Raises | |
UnprojectableFieldError | When an entry is an Object. |
DuplicateVariableNameError | When a name is already taken in that container. |
DeclarationError | When the machinery item cannot render a plan, because it does not carry the ROS2 mixins. |
Read one container into the plan's values, by name.
Elements of a structure array come back as maps of their fields, the form a Projection builds a message from. Raises ValueError for a value that is not an array of the variable's structure, which the write check normally prevents.
Log a decoded name its shape never created, and skip the value.
Unreachable with the generic Projection. A curated one whose halves disagree only shows up with a message, so it is logged and not raised.
Put every variable of one container back to the plan's initial value.
That is a typed zero only where the declaration says so; a curated Projection may choose another value.
Write one value to a variable's node with the variant type the plan decided.
Written on the node, so no write check runs: the value comes from ROS2 or the declaration.