rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
|
Public Member Functions | |
__init__ (self, node_name, *context=None, cli_args=None, namespace=None, use_global_arguments=True, enable_rosout=True, start_parameter_services=None, parameter_overrides=None, allow_undeclared_parameters=False, automatically_declare_parameters_from_overrides=False) | |
Creates a ROS1 node. | |
add_on_set_parameters_callback (self, callback) | |
Add a callback in front to the list of callbacks. | |
add_waitable (self, waitable) | |
Does nothing (ROS2 API compatibility stand-in). | |
count_publishers (self, topic_name) | |
Return the number of publishers on a given topic, globally. | |
count_subscribers (self, topic_name) | |
Return the number of subscribers on a given topic. | |
create_client (self, srv_type, srv_name, *qos_profile=None, callback_group=None) | |
Creates a new service client. | |
create_guard_condition (self, callback, callback_group=None) | |
Does nothing and returns None (ROS2 API compatibility stand-in). | |
create_publisher (self, msg_type, topic, qos_profile, *callback_group=None, event_callbacks=None) | |
Creates a new publisher. | |
create_rate (self, frequency, clock=None) | |
Creates a rate object. | |
create_service (self, srv_type, srv_name, callback, *qos_profile=None, callback_group=None) | |
Creates a new service server. | |
create_subscription (self, msg_type, topic, callback, qos_profile, *callback_group=None, event_callbacks=None, raw=False) | |
Creates a new subscription. | |
create_timer (self, timer_period_sec, callback, callback_group=None, clock=None) | |
Creates a new timer. | |
declare_parameter (self, name, value=None, descriptor=None, ignore_override=False) | |
Sets and initializes a node parameter. | |
declare_parameters (self, namespace, parameters, ignore_override=False) | |
Sets a list of parameters. | |
describe_parameter (self, name) | |
Get the parameter descriptor of a given parameter. | |
describe_parameters (self, names) | |
Get the parameter descriptors of a given list of parameters. | |
destroy_client (self, client) | |
Destroy a service client created by the node. | |
destroy_guard_condition (self, guard) | |
Does nothing (ROS2 API compatibility stand-in). | |
destroy_node (self) | |
Destroys the node and shuts down rospy. | |
destroy_publisher (self, publisher) | |
Destroy a publisher created by the node. | |
destroy_rate (self, rate) | |
Does nothing (ROS2 API compatibility stand-in). | |
destroy_service (self, service) | |
Destroy a service server created by the node. | |
destroy_subscription (self, subscription) | |
Destroy a subscription created by the node. | |
destroy_timer (self, timer) | |
Destroy a timer created by the node. | |
get_client_names_and_types_by_node (self, node_name, node_namespace) | |
Returns an empty list (ROS2 API compatibility stand-in) | |
get_clock (self) | |
Returns `clock.Clock` using ROS time. | |
get_logger (self) | |
Get the node's logger. | |
get_name (self) | |
Returns the name of the node, without namespace. | |
get_namespace (self) | |
Returns the namespace of the node. | |
get_node_names (self) | |
Get a list of names for discovered nodes. | |
get_node_names_and_namespaces (self) | |
Get a list of names and namespaces for discovered nodes. | |
get_node_names_and_namespaces_with_enclaves (self) | |
Get a list of names, namespaces and enclaves for discovered nodes. | |
get_parameter (self, name) | |
Returns a parameter by name. | |
get_parameter_or (self, name, alternative_value=None) | |
Returns a parameter or the alternative value. | |
get_parameters (self, names) | |
Returns a list of parameters. | |
get_parameters_by_prefix (self, prefix) | |
Get parameters that have a given prefix in their names as a dictionary. | |
get_publisher_names_and_types_by_node (self, node_name, node_namespace, no_demangle=False) | |
Gets a list of discovered topics for publishers of a remote node. | |
get_publishers_info_by_topic (self, topic_name, no_mangle=False) | |
Return a list of publishers on a given topic. | |
get_service_names_and_types (self) | |
Gets a list of available services. | |
get_service_names_and_types_by_node (self, node_name, node_namespace) | |
Gets a list of discovered service server topics for a remote node. | |
get_subscriber_names_and_types_by_node (self, node_name, node_namespace, no_demangle=False) | |
Gets a list of discovered topics for subscriptions of a remote node. | |
get_subscriptions_info_by_topic (self, topic_name, no_mangle=False) | |
Return a list of subscriptions on a given topic. | |
get_topic_names_and_types (self, no_demangle=False) | |
Gets a list of available topic names and types. | |
has_parameter (self, name) | |
Returns whether parameter exists. | |
remove_on_set_parameters_callback (self, callback) | |
Remove a callback from list of callbacks. | |
remove_waitable (self, waitable) | |
Does nothing (ROS2 API compatibility stand-in). | |
set_descriptor (self, name, descriptor, alternative_value=None) | |
Set a new descriptor for a given parameter. | |
set_parameters (self, parameter_list) | |
Set parameters for the node, and return the result for the set action. | |
set_parameters_atomically (self, parameter_list) | |
Set the given parameters, all at one time, and then aggregate result. | |
set_parameters_callback (self, callback) | |
Register a set parameters callback. | |
undeclare_parameter (self, name) | |
Unset a previously set parameter. | |
Static Public Attributes | |
int | PARAM_REL_TOL = 1e-6 |
Relative tolerance for floating-point parameter range steps. | |
Protected Member Functions | |
_apply_descriptor (self, parameter, descriptor=None, check_read_only=True) | |
Apply a descriptor to a parameter and return a result without saving the parameter. | |
_apply_descriptor_and_set (self, parameter, descriptor=None, check_read_only=True) | |
Apply parameter descriptor and set parameter if successful. | |
_apply_descriptors (self, parameter_list, descriptors, check_read_only=True) | |
Apply descriptors to parameters and return an aggregated result without saving parameters. | |
_apply_floating_point_range (self, parameter, floating_point_range) | |
Returns whether parameter value passes floating-point range check. | |
_apply_integer_range (self, parameter, integer_range) | |
Returns whether parameter value passes integer range check. | |
_check_undeclared_parameters (self, parameter_list) | |
Check if all parameters in list have correct types and were declared beforehand. | |
_get_info_by_topic (self, topic_name, endpoint_type, no_mangle) | |
Returns a list of `TopicEndpointInfo`. | |
_set_parameters (self, parameter_list, descriptors=None, raise_on_failure=False, allow_undeclared_parameters=False) | |
Set parameters for the node, and return the result for the set action. | |
_set_parameters_atomically (self, parameter_list, descriptors=None, allow_not_set_type=False) | |
Set the given parameters, all at one time, and then aggregate result. | |
Protected Attributes | |
_allow_undeclared_parameters | |
_clock | |
_descriptors | |
_parameter_overrides | |
_parameters | |
_parameters_callbacks | |
Properties | |
clients = property | |
Yields clients that have been created on this node. | |
context = property | |
Returns None (ROS2 API compatibility stand-in). | |
default_callback_group = property | |
Returns None (ROS2 API compatibility stand-in). | |
executor = property | |
Returns None (ROS2 API compatibility stand-in). | |
guards = property | |
Yields (ROS2 API compatibility stand-in). | |
handle = property | |
Returns None (ROS2 API compatibility stand-in). | |
publishers = property | |
Yields publishers that have been created on this node. | |
services = property | |
Yields services that have been created on this node. | |
subscriptions = property | |
Yields subscriptions that have been created on this node. | |
timers = property | |
Yields timers that have been created on this node. | |
waitables = property | |
Yields (ROS2 API compatibility stand-in). | |
rosros.rclify.node.Node.__init__ | ( | self, | |
node_name, | |||
* | context = None , |
||
cli_args = None , |
|||
namespace = None , |
|||
use_global_arguments = True , |
|||
enable_rosout = True , |
|||
start_parameter_services = None , |
|||
parameter_overrides = None , |
|||
allow_undeclared_parameters = False , |
|||
automatically_declare_parameters_from_overrides = False |
|||
) |
Creates a ROS1 node.
node_name | a name to give to this node |
context | ignored (ROS2 API compatibility stand-in) |
cli_args | a list of strings of command line args to be used only by this node; these arguments are used to extract remappings used by the node and other ROS specific settings, as well as user defined non-ROS arguments |
namespace | the namespace to which relative topic and service names will be prefixed |
use_global_arguments | `False` if the node should ignore process-wide command line args |
enable_rosout | `False` if the node should ignore rosout logging |
start_parameter_services | ignored (ROS2 API compatibility stand-in) |
parameter_overrides | list of `Parameter` overrides for initial values of parameters declared on the node |
allow_undeclared_parameters | true if undeclared parameters are allowed; this flag affects the behavior of parameter-related operations |
automatically_declare_parameters_from_overrides | if True, `parameter_overrides` will be used to implicitly declare parameters on the node |
|
protected |
Apply a descriptor to a parameter and return a result without saving the parameter.
This method sets the type in the descriptor to match the parameter type. If a descriptor is provided, its name will be set to the name of the parameter.
parameter | `Parameter` to be checked |
descriptor | `ParameterDescriptor` to apply, or None to use the stored descriptor |
check_read_only | whether to check for read-only descriptor |
ParameterNotDeclaredException | if descriptor is not provided, the given parameter is unknown and undeclared parameters are not allowed |
|
protected |
|
protected |
Apply descriptors to parameters and return an aggregated result without saving parameters.
In case no descriptors are provided to the method, existing descriptors shall be used. In any case, if a given parameter doesn't have a descriptor it shall be skipped.
parameter_list | list of `Parameter` to be checked |
descriptors | `{name: `ParameterDescriptor}` to apply |
check_read_only | whether to check for read-only descriptors |
ParameterNotDeclaredException | if a descriptor is not provided, a given parameter is unknown and undeclared parameters are not allowed |
|
protected |
Returns whether parameter value passes floating-point range check.
Value must fall into given min-max range, endpoints included, and be a tolerably exact number of steps from range start if range has step defined.
parameter | `Parameter` to check |
floating_point_range | `FloatingPointRange` to use |
|
protected |
Returns whether parameter value passes integer range check.
Value must fall into given min-max range, endpoints included, and be an exact number of steps from range start if range has step defined.
parameter | `Parameter` to check |
integer_range | `IntegerRange` to use |
|
protected |
|
protected |
|
protected |
Set parameters for the node, and return the result for the set action.
Method for internal usage; applies a setter method for each parameters in the list. By default it checks if the parameters were declared, raising an exception if at least one of them was not.
If a callback was registered previously with `add_on_set_parameters_callback`, it will be called prior to setting the parameters for the node, once for each parameter. If the callback doesn't succeed for a given parameter, it won't be set and either an unsuccessful result will be returned for that parameter, or an exception will be raised according to `raise_on_failure` flag.
parameter_list | list of `Parameter` to set. |
descriptors | descriptors to set to the given parameters, as ParameterDescriptor}`, either one for each parameter or none at all |
raise_on_failure | raise `InvalidParameterValueException` if any set-parameters callback rejects a parameter |
allow_undeclared_parameters | auto-declare unknown parameters |
InvalidParameterValueException | if any set-parameters callback rejects a parameter and `raise_on_failure` is true |
ParameterNotDeclaredException | if undeclared parameters are not allowed, and any given parameter is unknown |
|
protected |
Set the given parameters, all at one time, and then aggregate result.
This internal method does not reject undeclared parameters. If `allow_not_set_type` is False, a parameter with type `NOT_SET` will be undeclared.
If a callback was registered previously with `add_on_set_parameters_callback`, it will be called prior to setting the parameters for the node only once for all parameters. If the callback prevents the parameters from being set, then it will be reflected in the returned result; no exceptions will be raised in this case.
parameter_list | list of `Parameter` to set |
descriptors | new descriptors to apply to the parameters before setting them, as ParameterDescriptor}`, one for each parameter or none at all |
allow_not_set_type | whether to store parameters of `NOT_SET` type, or undeclare them if False |
rosros.rclify.node.Node.add_on_set_parameters_callback | ( | self, | |
callback | |||
) |
rosros.rclify.node.Node.add_waitable | ( | self, | |
waitable | |||
) |
rosros.rclify.node.Node.count_publishers | ( | self, | |
topic_name | |||
) |
Return the number of publishers on a given topic, globally.
`topic_name` may be a relative, private, or fully qualifed topic name. A relative or private topic is expanded using this node's namespace and name. The queried topic name is not remapped.
topic_name | the topic_name on which to count the number of publishers |
rosros.rclify.node.Node.count_subscribers | ( | self, | |
topic_name | |||
) |
Return the number of subscribers on a given topic.
`topic_name` may be a relative, private, or fully qualifed topic name. A relative or private topic is expanded using this node's namespace and name. The queried topic name is not remapped.
topic_name | the topic_name on which to count the number of subscribers |
rosros.rclify.node.Node.create_client | ( | self, | |
srv_type, | |||
srv_name, | |||
* | qos_profile = None , |
||
callback_group = None |
|||
) |
Creates a new service client.
srv_type | type class of the service, like `std_srvs.srv.Trigger` |
srv_name | the name of the service |
qos_profile | ignored (ROS2 API compatibility stand-in) |
callback_group | ignored (ROS2 API compatibility stand-in) |
rosros.rclify.node.Node.create_guard_condition | ( | self, | |
callback, | |||
callback_group = None |
|||
) |
rosros.rclify.node.Node.create_publisher | ( | self, | |
msg_type, | |||
topic, | |||
qos_profile, | |||
* | callback_group = None , |
||
event_callbacks = None |
|||
) |
Creates a new publisher.
msg_type | type class of ROS messages the publisher will publish |
topic | the name of the topic the publisher will publish to |
qos_profile | a `QoSProfile` or a queue size to apply to the publisher, publisher will be latched if `durability` is `TRANSIENT_LOCAL` |
callback_group | ignored (ROS2 API compatibility stand-in) |
event_callbacks | ignored (ROS2 API compatibility stand-in) |
rosros.rclify.node.Node.create_rate | ( | self, | |
frequency, | |||
clock = None |
|||
) |
Creates a rate object.
The timer will be started and every `timer_period_sec` number of seconds the provided callback function will be called.
frequency | the frequency the Rate runs at (Hz) |
clock | ignored (ROS2 API compatibility stand-in) |
rosros.rclify.node.Node.create_service | ( | self, | |
srv_type, | |||
srv_name, | |||
callback, | |||
* | qos_profile = None , |
||
callback_group = None |
|||
) |
Creates a new service server.
srv_type | type class of the service, like `std_srvs.srv.Trigger` |
srv_name | the name of the service |
callback | a user-defined callback function that is called when a service request is received by the server, as callback(request, response) |
qos_profile | ignored (ROS2 API compatibility stand-in) |
callback_group | ignored (ROS2 API compatibility stand-in) |
rosros.rclify.node.Node.create_subscription | ( | self, | |
msg_type, | |||
topic, | |||
callback, | |||
qos_profile, | |||
* | callback_group = None , |
||
event_callbacks = None , |
|||
raw = False |
|||
) |
Creates a new subscription.
msg_type | type class of ROS messages the subscription will subscribe to. |
topic | the name of the topic the subscription will subscribe to |
callback | a user-defined callback function that is called when a message is received by the subscription |
qos_profile | a `QoSProfile` or a queue size to apply to the subscription |
callback_group | ignored (ROS2 API compatibility stand-in) |
event_callbacks | ignored (ROS2 API compatibility stand-in) |
raw | if `True`, then subscription will be done with `rospy.AnyMsg`, providing message raw binary bytes |
rosros.rclify.node.Node.create_timer | ( | self, | |
timer_period_sec, | |||
callback, | |||
callback_group = None , |
|||
clock = None |
|||
) |
Creates a new timer.
The timer will be started and every `timer_period_sec` number of seconds the provided callback function will be called.
timer_period_sec | the period (s) of the timer |
callback | a user-defined callback function that is called when the timer expires |
callback_group | ignored (ROS2 API compatibility stand-in) |
clock | the clock which the timer gets time from |
rosros.rclify.node.Node.declare_parameter | ( | self, | |
name, | |||
value = None , |
|||
descriptor = None , |
|||
ignore_override = False |
|||
) |
Sets and initializes a node parameter.
This method, if successful, will result in any callback registered with `add_on_set_parameters_callback` to be called.
name | fully-qualified name of the parameter, including its namespace |
value | value of the parameter to set, if any |
descriptor | `ParameterDescriptor` instance, if any |
ignore_override | whether to set value given here, ignoring any overrides |
ParameterAlreadyDeclaredException | if the parameter has already been set |
InvalidParameterException | if the parameter name is invalid |
InvalidParameterValueException | if a registered callback rejects the parameter |
rosros.rclify.node.Node.declare_parameters | ( | self, | |
namespace, | |||
parameters, | |||
ignore_override = False |
|||
) |
Sets a list of parameters.
The tuples in the given parameter list shall contain the name for each parameter, optionally providing a value and a descriptor. For each entry in the list, a parameter with a name of "namespace.name" will be set. The resulting value for each set parameter will be returned, considering parameter overrides set upon node creation as the first choice, or provided parameter values as the second one.
The name expansion is naive, so if you set the namespace to be "foo.", then the resulting parameter names will be like "foo..name". However, if the namespace is an empty string, then no leading '.' will be placed before each name, which would have been the case when naively expanding "namespace.name". This allows you to declare several parameters at once without a namespace.
This method, if successful, will result in any callback registered with `add_on_set_parameters_callback` to be called once for each parameter. If one of those calls fail, an exception will be raised and the remaining parameters will not be declared. Parameters declared up to that point will not be undeclared.
namespace | namespace for parameters (empty string for node root namespace) |
parameters | list of tuples with parameters to set, as (name, ) or (name, value) or (name, value, descriptor) |
ignore_override | whether to set value given here, ignoring any overrides |
ParameterAlreadyDeclaredException | if a parameter has already been set |
InvalidParameterException | if a parameter name is invalid. |
InvalidParameterValueException | if a registered callback rejects any parameter |
TypeError | if any tuple in `parameters` does not match the annotated type |
rosros.rclify.node.Node.describe_parameter | ( | self, | |
name | |||
) |
Get the parameter descriptor of a given parameter.
name | fully-qualified name of the parameter, including its namespace |
ParameterNotDeclaredException | if parameter is unknown and undeclared parameters are not allowed |
rosros.rclify.node.Node.describe_parameters | ( | self, | |
names | |||
) |
Get the parameter descriptors of a given list of parameters.
name | list of fully-qualified names of the parameters to describe |
ParameterNotDeclaredException | if any parameter is unknown and undeclared parameters are not allowed |
rosros.rclify.node.Node.destroy_client | ( | self, | |
client | |||
) |
rosros.rclify.node.Node.destroy_guard_condition | ( | self, | |
guard | |||
) |
rosros.rclify.node.Node.destroy_node | ( | self | ) |
rosros.rclify.node.Node.destroy_publisher | ( | self, | |
publisher | |||
) |
rosros.rclify.node.Node.destroy_rate | ( | self, | |
rate | |||
) |
rosros.rclify.node.Node.destroy_service | ( | self, | |
service | |||
) |
rosros.rclify.node.Node.destroy_subscription | ( | self, | |
subscription | |||
) |
rosros.rclify.node.Node.destroy_timer | ( | self, | |
timer | |||
) |
rosros.rclify.node.Node.get_client_names_and_types_by_node | ( | self, | |
node_name, | |||
node_namespace | |||
) |
rosros.rclify.node.Node.get_clock | ( | self | ) |
rosros.rclify.node.Node.get_logger | ( | self | ) |
rosros.rclify.node.Node.get_name | ( | self | ) |
rosros.rclify.node.Node.get_namespace | ( | self | ) |
rosros.rclify.node.Node.get_node_names | ( | self | ) |
rosros.rclify.node.Node.get_node_names_and_namespaces | ( | self | ) |
rosros.rclify.node.Node.get_node_names_and_namespaces_with_enclaves | ( | self | ) |
rosros.rclify.node.Node.get_parameter | ( | self, | |
name | |||
) |
Returns a parameter by name.
name | fully-qualified name of the parameter, including its namespace |
ParameterNotDeclaredException | if undeclared parameters are not allowed, and the parameter is unknown |
rosros.rclify.node.Node.get_parameter_or | ( | self, | |
name, | |||
alternative_value = None |
|||
) |
Returns a parameter or the alternative value.
If the alternative value is None, a default `Parameter` with the given name and `NOT_SET` type will be returned if the parameter was not declared.
name | fully-qualified name of the parameter, including its namespace |
alternative_value | alternative parameter to return if unknown |
rosros.rclify.node.Node.get_parameters | ( | self, | |
names | |||
) |
Returns a list of parameters.
names | fully-qualified names of the parameters to get, including namespaces |
ParameterNotDeclaredException | if undeclared parameters are not allowed, and any given parameter is unknown |
rosros.rclify.node.Node.get_parameters_by_prefix | ( | self, | |
prefix | |||
) |
Get parameters that have a given prefix in their names as a dictionary.
The names which are used as keys in the returned dictionary have the prefix removed. For example, if you use the prefix "foo" and the parameters "foo.ping", "foo.pong" and "bar.baz" exist, then the returned dictionary will have the keys "ping" and "pong". Note that the parameter separator is also removed from the parameter name to create the keys.
An empty string for the prefix will match all parameters.
If no parameters with the prefix are found, an empty dictionary will be returned.
prefix | the prefix of the parameters to get |
rosros.rclify.node.Node.get_publisher_names_and_types_by_node | ( | self, | |
node_name, | |||
node_namespace, | |||
no_demangle = False |
|||
) |
Gets a list of discovered topics for publishers of a remote node.
node_name | name of a remote node to get publishers for |
node_namespace | namespace of the remote node |
no_demangle | ignored (ROS2 API compatibility stand-in) |
NodeNameNonExistentError | if the node wasn't found |
RuntimeError | unexpected failure |
rosros.rclify.node.Node.get_publishers_info_by_topic | ( | self, | |
topic_name, | |||
no_mangle = False |
|||
) |
Return a list of publishers on a given topic.
The returned parameter is a list of TopicEndpointInfo objects, where each will contain the node name, node namespace, topic type, topic endpoint's GID, and its QoS profile.
`topic_name` may be a relative, private, or fully qualified topic name. A relative or private topic will be expanded using this node's namespace and name. The queried `topic_name` is not remapped.
topic_name | the topic_name on which to find the publishers |
no_mangle | whether topic name should be used as is, by default it will be namespaced under node and remapped |
rosros.rclify.node.Node.get_service_names_and_types | ( | self | ) |
rosros.rclify.node.Node.get_service_names_and_types_by_node | ( | self, | |
node_name, | |||
node_namespace | |||
) |
Gets a list of discovered service server topics for a remote node.
node_name | name of a remote node to get services for |
node_namespace | namespace of the remote node |
NodeNameNonExistentError | if the node wasn't found |
RuntimeError | unexpected failure |
rosros.rclify.node.Node.get_subscriber_names_and_types_by_node | ( | self, | |
node_name, | |||
node_namespace, | |||
no_demangle = False |
|||
) |
Gets a list of discovered topics for subscriptions of a remote node.
node_name | name of a remote node to get subscriptions for |
node_namespace | namespace of the remote node |
no_demangle | ignored (ROS2 API compatibility stand-in) |
NodeNameNonExistentError | if the node wasn't found |
RuntimeError | unexpected failure |
rosros.rclify.node.Node.get_subscriptions_info_by_topic | ( | self, | |
topic_name, | |||
no_mangle = False |
|||
) |
Return a list of subscriptions on a given topic.
The returned parameter is a list of TopicEndpointInfo objects, where each will contain the node name, node namespace, topic type, topic endpoint's GID, and its QoS profile.
When the `no_mangle` parameter is `true`, the provided `topic_name` should be a valid topic name for the middleware (useful when combining ROS with native middleware (e.g. DDS) apps). When the `no_mangle` parameter is `false`, the provided `topic_name` should follow ROS topic name conventions.
`topic_name` may be a relative, private, or fully qualified topic name. A relative or private topic will be expanded using this node's namespace and name. The queried `topic_name` is not remapped.
topic_name | the topic_name on which to find the subscriptions |
no_mangle | whether topic name should be used as is, by default it will be namespaced under node and remapped |
rosros.rclify.node.Node.get_topic_names_and_types | ( | self, | |
no_demangle = False |
|||
) |
rosros.rclify.node.Node.has_parameter | ( | self, | |
name | |||
) |
rosros.rclify.node.Node.remove_on_set_parameters_callback | ( | self, | |
callback | |||
) |
rosros.rclify.node.Node.remove_waitable | ( | self, | |
waitable | |||
) |
rosros.rclify.node.Node.set_descriptor | ( | self, | |
name, | |||
descriptor, | |||
alternative_value = None |
|||
) |
Set a new descriptor for a given parameter.
The name in the descriptor is ignored and set to given `name`.
name | fully-qualified name of the parameter to set the descriptor to |
descriptor | new `ParameterDescriptor` to apply to the parameter |
alternative_value | `ParameterValue` to set to the parameter if the existing value does not comply with the new descriptor |
ParameterNotDeclaredException | if the parameter is unknown and undeclared parameters are not allowed |
ParameterImmutableException | if the parameter exists and is read-only |
ParameterValueException | if neither the existing value nor the alternative value comply with the provided descriptor |
rosros.rclify.node.Node.set_parameters | ( | self, | |
parameter_list | |||
) |
Set parameters for the node, and return the result for the set action.
If any parameter in the list was not declared beforehand and undeclared parameters are not allowed for the node, this method will raise a ParameterNotDeclaredException exception.
Parameters are set in the order they are declared in the list. If setting a parameter fails due to not being declared, then the parameters which have already been set will stay set, and no attempt will be made to set the parameters which come after.
If undeclared parameters are allowed, then all the parameters will be implicitly declared before being set even if they were not declared beforehand. Parameter overrides are ignored by this method.
If a callback was registered previously with `add_on_set_parameters_callback`, it will be called prior to setting the parameters for the node, once for each parameter. If the callback prevents a parameter from being set, then it will be reflected in the returned result; no exceptions will be raised in this case.
If the value type of the parameter is NOT_SET, and the existing parameter type is something else, then the parameter will be implicitly undeclared.
parameter_list | list of `Parameter` to set |
ParameterNotDeclaredException | if undeclared parameters are not allowed, and any given parameter is unknown |
rosros.rclify.node.Node.set_parameters_atomically | ( | self, | |
parameter_list | |||
) |
Set the given parameters, all at one time, and then aggregate result.
If any parameter in the list was not declared beforehand and undeclared parameters are not allowed for the node, this method will raise a `ParameterNotDeclaredException` exception.
Parameters are set all at once. If setting a parameter fails due to not being declared, then no parameter will be set. Either all of the parameters are set or none of them are set.
If undeclared parameters are allowed for the node, then all the parameters will be implicitly declared before being set even if they were not declared beforehand.
If a callback was registered previously with `add_on_set_parameters_callback`, it will be called prior to setting the parameters for the node only once for all parameters. If the callback prevents the parameters from being set, then it will be reflected in the returned result; no exceptions will be raised in this case.
If the value type of the parameter is `NOT_SET`, and the existing parameter type is something else, then the parameter will be implicitly undeclared.
parameter_list | list of `Parameter` to set |
ParameterNotDeclaredException | if undeclared parameters are not allowed, and any named parameter is unknown |
rosros.rclify.node.Node.set_parameters_callback | ( | self, | |
callback | |||
) |
rosros.rclify.node.Node.undeclare_parameter | ( | self, | |
name | |||
) |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |