better_launch.elements.live_params_mixin moduleο
- class better_launch.elements.live_params_mixin.LiveParamsMixinο
Bases:
objectMixin class to add interactions with ROS parameters for running nodes. This class must be mixed in with an object providing a fullname member.
- get_live_params(*params: str, timeout: float = 5.0) dict[str, Any]ο
Retrieves the values for the specified ROS parameters of this node. If no parameters are provided, all parameters will be listed.
Note that this is different from the params used to start the node. This method will directly query the ROS node for its parameters, while params is used to pass arguments on startup.
Parametersο
- *paramsstr
ROS parameter names to retrieve.
- timeoutfloat, optional
How long to wait for the service to connect.
Returnsο
- Any
The names and values of the ROS parameters of this node as specified.
Raisesο
- TimeoutError
If the service fails to connect.
- list_live_params(*, timeout: float = 5.0) list[str]ο
List the names of the ROS parameters this node has registered.
Note that this is different from the params used to start the node. This method will directly query the ROS node for its parameters, while params is used to pass arguments on startup.
Parametersο
- timeoutfloat, optional
How long to wait for the service to connect.
Returnsο
- list[str]
A list of this nodeβs ROS parameters.
Raisesο
- TimeoutError
If the service fails to connect.
- set_live_params(params: dict[str, Any], *, timeout: float = 5.0) dict[str, bool]ο
Sets the specified ROS parameters on this node.
Note that this is different from the params used to start the node. This method will directly query the ROS node for its parameters, while params is used to pass arguments on startup.
Parametersο
- paramsdict[str, Any]
The parameters to update.
- timeoutfloat, optional
How long to wait for the service to connect.
Returnsο
- dict[str, bool]:
A dict showing which parameter updates succeeded.
Raisesο
- TimeoutError
If the service fails to connect.
- set_live_params_atomic(params: dict[str, Any], *, timeout: float = 5.0) boolο
Sets the specified ROS parameters on this node. No updates will be performed if any of the operations fail.
Note that this is different from the params used to start the node. This method will directly query the ROS node for its parameters, while params is used to pass arguments on startup.
Parametersο
- paramsdict[str, Any]
The parameters to update.
- timeoutfloat, optional
How long to wait for the service to connect.
Returnsο
- bool:
True if all updates succeeded, False otherwise.
Raisesο
- TimeoutError
If the service fails to connect.