class documentation

class ROS2ParameterBinding(AwaitedBinding):

View In Hierarchy

The ROS2 parameters of one node, exposed as Parameters on the declaring Component.

One declaration per ROS2 node: its parameter services share one path and its changes arrive on /parameter_events under one node name. A Component that tunes two nodes declares two. The ROS2 qualifier is in the name because bare Parameter is opensmi vocabulary for the OPC UA variable.

Names, types and read-only marks are declared, never discovered. The nine-way rcl_interfaces/msg/ParameterValue union never reaches OPC UA: the declaration names one typed field and the Parameter is a scalar of that type. A UA Parameter's access level is fixed when the node is created, so read-only cannot be learned from the robot later. A parameter the node marks read-only itself still has every write refused with BadNotWritable.

A client's write is checked against the node's descriptor and sent with set_parameters. The client is answered Good and the value stored only when the node took it. Declaring a parameter here is the only way to make it writable; the introspection Component only lists and describes them.

Method __post_init__ Refuse a contradictory declaration.
Method node_path Return the browse names of a parameter's namespace groups, then the variable itself.
Method writable Return whether a client may write one of this Binding's declared parameters.
Class Variable kind Undocumented
Instance Variable name The Binding's name, the group its Parameters sit in. A ROS2 name such as FollowPath.max_vel_x is one group per namespace level and then the variable: <name>/FollowPath/MaxVelX, with each segment converted to a browse name.
Instance Variable parameters Map from ROS2 parameter name to type. An empty map is fatal at init. This is the one Binding with a mapping field and so the one that is not hashable; nothing here hashes a Binding.
Instance Variable path The ROS2 node, fully qualified. A missing leading / is added.
Instance Variable read_only Names among parameters that a client may not write. A name not declared in parameters is fatal at init.
Instance Variable required Whether the StartupSkill waits for this Binding before Running. Unlike other kinds it is satisfied only when every declared name is confirmed on the node, so a typo leaves it unsatisfied.
Instance Variable retry_interval Seconds before a parameter not yet confirmed on the node is read again. It lifts BadNoCommunication from a node that was off at boot, which /parameter_events would never announce. Nothing is read while every name is confirmed.
Instance Variable startup_timeout Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.
Instance Variable write_timeout Seconds a client's write waits for the node before BadTimeout. The default, WRITE_TIMEOUT, is below the client's own timeout.
Property needs_the_graph Return False: names and types are declared.
def __post_init__(self):

Refuse a contradictory declaration.

Raises
ParameterDeclarationErrorWhen the declaration exposes nothing, marks a name read-only that it does not expose, or has a retry interval or write timeout that is not positive.
RequiredDeclarationErrorWhen startup_timeout is declared without required, or is not positive.
def node_path(self, parameter: str) -> tuple[str, ...]:

Return the browse names of a parameter's namespace groups, then the variable itself.

Raises
BindingNameErrorWhen a segment does not convert, see browse_name.
def writable(self, parameter: str) -> bool:

Return whether a client may write one of this Binding's declared parameters.

kind: ClassVar[str] =

Undocumented

name =

The Binding's name, the group its Parameters sit in. A ROS2 name such as FollowPath.max_vel_x is one group per namespace level and then the variable: <name>/FollowPath/MaxVelX, with each segment converted to a browse name.

parameters: dict[str, ParameterType] =

Map from ROS2 parameter name to type. An empty map is fatal at init. This is the one Binding with a mapping field and so the one that is not hashable; nothing here hashes a Binding.

path: str =

The ROS2 node, fully qualified. A missing leading / is added.

read_only: tuple[str, ...] =

Names among parameters that a client may not write. A name not declared in parameters is fatal at init.

required =

Whether the StartupSkill waits for this Binding before Running. Unlike other kinds it is satisfied only when every declared name is confirmed on the node, so a typo leaves it unsatisfied.

retry_interval: float =

Seconds before a parameter not yet confirmed on the node is read again. It lifts BadNoCommunication from a node that was off at boot, which /parameter_events would never announce. Nothing is read while every name is confirmed.

startup_timeout =

Seconds that wait lasts, or None for the deployment's default. Refused when the Binding is constructed without required.

write_timeout: float =

Seconds a client's write waits for the node before BadTimeout. The default, WRITE_TIMEOUT, is below the client's own timeout.

@property
needs_the_graph: bool =

Return False: names and types are declared.

Whether the node is there is answered by reading a parameter, not the graph.