class ParameterFacet:
Constructor: ParameterFacet(read, write, events, list_names, ...)
The ROS2 parameters of every node on one Machine's graph.
Obtain it from opensmi.ros2.runtime.runtime.Runtime.parameters; the constructor
arguments are the Runtime's plumbing.
| Method | __init__ |
Describe a facet without calling anything. |
| Method | __repr__ |
Return a representation naming how many watches are open and what it has done. |
| Async Method | close |
End every watch and close the subscription, which is what stopping the Runtime does. |
| Async Method | describe |
Describe one parameter of one ROS2 node: its type, description and constraints. |
| Async Method | get |
Read one parameter of one ROS2 node. |
| Async Method | list |
Return every ROS2 parameter name one node declares, in the order the node gave them. |
| Async Method | set |
Write parameters to one ROS2 node, never atomically, and report per parameter. |
| Async Method | settle |
Close the shared subscription if nothing is watching. Called by a watch as it closes. |
| Method | watch |
Follow one ROS2 node's parameter changes, subscribing if nothing was watching yet. |
| Async Method | _follow |
Demux /parameter_events onto the watches, by node, until cancelled. |
| Method | _start |
Open the one subscription, unless it is already open or nothing is watching. |
| Instance Variable | _describe |
Undocumented |
| Instance Variable | _events |
Undocumented |
| Instance Variable | _list |
Undocumented |
| Instance Variable | _read |
Undocumented |
| Instance Variable | _reads |
Undocumented |
| Instance Variable | _stream |
Undocumented |
| Instance Variable | _task |
Undocumented |
| Instance Variable | _watches |
Undocumented |
| Instance Variable | _write |
Undocumented |
| Instance Variable | _writes |
Undocumented |
| Property | _watching |
Return whether /parameter_events is subscribed (exactly while a watch is open). |
ReadFunction, write: WriteFunction, events: EventFunction, list_names: ListFunction, describe: DescribeFunction):
¶
Describe a facet without calling anything.
| Parameters | |
read:ReadFunction | How to read one parameter of one node. |
write:WriteFunction | How to write a batch to one node, per parameter. |
events:EventFunction | How to follow /parameter_events. Opened on the first watch and closed with the last. |
listListFunction | How to ask one node what parameters it declares. |
describe:DescribeFunction | How to ask one node about one of those names. |
Describe one parameter of one ROS2 node: its type, description and constraints.
A name the node does not have comes back as a description that is not present. Counted as a read.
| Parameters | |
node:str | The ROS2 node path. A leading / is added when it is missing. |
name:str | The ROS2 parameter name, dotted as the node spells it. |
| Returns | |
ParameterDescription | Undocumented |
| Raises | |
ServiceUnavailableError | When the node's parameter services do not answer. |
ServiceCallTimeoutError | When the request went and no answer came back in time. |
Read one parameter of one ROS2 node.
A name the node does not have is not an error: it comes back as a reading that is not present.
| Parameters | |
node:str | The ROS2 node path. A leading / is added when it is missing. |
name:str | The ROS2 parameter name, dotted as the node spells it. |
| Returns | |
ParameterReading | Undocumented |
| Raises | |
ServiceUnavailableError | When the node's parameter services do not answer. |
ServiceCallTimeoutError | When the request went and no answer came back in time. |
Return every ROS2 parameter name one node declares, in the order the node gave them.
This covers the whole node at once, since no names are asked for. A node with no parameters and a node that answered nothing both give an empty tuple. Counted as a read.
| Parameters | |
node:str | The ROS2 node path. A leading / is added when it is missing. |
| Returns | |
tuple[ | Undocumented |
| Raises | |
ServiceUnavailableError | When the node's parameter services do not answer. |
ServiceCallTimeoutError | When the request went and no answer came back in time. |
str, values: Mapping[ str, ParameterValue]) -> Mapping[ str, SetOutcome]:
¶
Write parameters to one ROS2 node, never atomically, and report per parameter.
Every valid entry lands and each refusal is named, even when others in the batch fail.
| Parameters | |
node:str | The ROS2 node path. A leading / is added when it is missing. |
values:Mapping[ | What to write, by ROS2 parameter name. |
| Returns | |
Mapping[ | One outcome per name asked for. An empty batch is not a call and answers empty. |
| Raises | |
ServiceUnavailableError | When the node's parameter services do not answer. |
ServiceCallTimeoutError | When the request went and no answer came back in time. |
Follow one ROS2 node's parameter changes, subscribing if nothing was watching yet.
| Parameters | |
node:str | The ROS2 node path. A leading / is added when it is missing. |
| Returns | |
ParameterWatch | A handle carrying the updates and its own lifetime. Close it when the consumer is done: the subscription closes with the last watch. |