better_launch.elements.live_params_mixin moduleο
- class better_launch.elements.live_params_mixin.LiveParamsMixinο
Bases:
object
Mixin 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.
This will only work if the node is up and running. Note that this is different from
params()
in that this method will directly query the ROS node, while params is only used when starting the node.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.
This will only work if the node is up and running. Note that this is different from
params()
in that this method will directly query the ROS node, while params is only used when starting the node.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.
This will only work if the node is up and running. This will also not change
params()
, which is used for starting the node.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.
This will only work if the node is up and running. This will also not change
params()
, which is used for starting the node.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.