class documentation

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).
def __init__(self, *, read: ReadFunction, write: WriteFunction, events: EventFunction, list_names: ListFunction, describe: DescribeFunction):

Describe a facet without calling anything.

Parameters
read:ReadFunctionHow to read one parameter of one node.
write:WriteFunctionHow to write a batch to one node, per parameter.
events:EventFunctionHow to follow /parameter_events. Opened on the first watch and closed with the last.
list_names:ListFunctionHow to ask one node what parameters it declares.
describe:DescribeFunctionHow to ask one node about one of those names.
def __repr__(self) -> str:

Return a representation naming how many watches are open and what it has done.

async def close(self):

End every watch and close the subscription, which is what stopping the Runtime does.

async def describe(self, *, node: str, name: str) -> ParameterDescription:

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:strThe ROS2 node path. A leading / is added when it is missing.
name:strThe ROS2 parameter name, dotted as the node spells it.
Returns
ParameterDescriptionUndocumented
Raises
ServiceUnavailableErrorWhen the node's parameter services do not answer.
ServiceCallTimeoutErrorWhen the request went and no answer came back in time.
async def get(self, *, node: str, name: str) -> ParameterReading:

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:strThe ROS2 node path. A leading / is added when it is missing.
name:strThe ROS2 parameter name, dotted as the node spells it.
Returns
ParameterReadingUndocumented
Raises
ServiceUnavailableErrorWhen the node's parameter services do not answer.
ServiceCallTimeoutErrorWhen the request went and no answer came back in time.
async def list(self, *, node: str) -> tuple[str, ...]:

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:strThe ROS2 node path. A leading / is added when it is missing.
Returns
tuple[str, ...]Undocumented
Raises
ServiceUnavailableErrorWhen the node's parameter services do not answer.
ServiceCallTimeoutErrorWhen the request went and no answer came back in time.
async def set(self, *, node: 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:strThe ROS2 node path. A leading / is added when it is missing.
values:Mapping[str, ParameterValue]What to write, by ROS2 parameter name.
Returns
Mapping[str, SetOutcome]One outcome per name asked for. An empty batch is not a call and answers empty.
Raises
ServiceUnavailableErrorWhen the node's parameter services do not answer.
ServiceCallTimeoutErrorWhen the request went and no answer came back in time.
async def settle(self):

Close the shared subscription if nothing is watching. Called by a watch as it closes.

def watch(self, node: str) -> ParameterWatch:

Follow one ROS2 node's parameter changes, subscribing if nothing was watching yet.

Parameters
node:strThe ROS2 node path. A leading / is added when it is missing.
Returns
ParameterWatchA handle carrying the updates and its own lifetime. Close it when the consumer is done: the subscription closes with the last watch.
async def _follow(self):

Demux /parameter_events onto the watches, by node, until cancelled.

def _start(self):

Open the one subscription, unless it is already open or nothing is watching.

_describe =

Undocumented

_events =

Undocumented

_list =

Undocumented

_read =

Undocumented

_reads: int =

Undocumented

_stream: AsyncGenerator[ParameterUpdate, None] | None =

Undocumented

_task: asyncio.Task[None] | None =

Undocumented

_watches: list[ParameterWatch] =

Undocumented

_write =

Undocumented

_writes: int =

Undocumented

@property
_watching: bool =

Return whether /parameter_events is subscribed (exactly while a watch is open).