Conversation
|
I might be wrong but based on my understanding we can only set one parameter currently using We should expose the |
The problem with that, though, is that
This we should definitely do. The other thing we could do is to fix up |
I see, makes sense! |
|
Right, I definitely wasn't thinking when I put this PR together 😅. Will update this PR to support multiple parameters & |
I'll suggest you do two separate PRs; the first one to add multiple param support to |
5bd9a70 to
13a8d16
Compare
|
This PR is based off that PR (#728) and now implements Diff: brianc/multiple_param_set...brianc/atomic_parameter_set |
Signed-off-by: Brian Chen <brian.chen@openrobotics.org>
Signed-off-by: Brian Chen <brian.chen@openrobotics.org>
13a8d16 to
fb6efc1
Compare
| @@ -50,6 +50,10 @@ def load_parameter_file(*, node, node_name, parameter_file, use_wildcard): | |||
| parameters = list(parameter_dict_from_yaml_file(parameter_file, use_wildcard).values()) | |||
| rclpy.spin_until_future_complete(node, future) | |||
| response = future.result() | |||
There was a problem hiding this comment.
i think this call will raise exception if there is an actual exception.
| future = client.load_parameter_file_atomically(parameter_file, use_wildcard) | ||
| parameters = list(parameter_dict_from_yaml_file(parameter_file, use_wildcard).values()) | ||
| rclpy.spin_until_future_complete(node, future) | ||
| response = future.result() |
| raise RuntimeError('Exception while calling service of node ' | ||
| f'{node_name}: {future.exception()}') | ||
|
|
||
| if response.result.successful: |
There was a problem hiding this comment.
if response.result.successful is false, user can know that loading parameter operation has been failed?
| f'{node_name}: {future.exception()}') | ||
|
|
||
| if response.result.successful: | ||
| msg = 'Set parameters {} successful'.format(' '.join([i.name for i in parameters])) |
There was a problem hiding this comment.
this whole operation is atomic, and user knows parameters as input, so i am not sure if we need print all parameters again here. probably this command prints the result only?
| client.wait_for_services(timeout_sec=5.0) | ||
| future = client.set_parameters_atomically(parameters) | ||
| rclpy.spin_until_future_complete(node, future) | ||
| response = future.result() |
This PR implements a
--atomicflag forros2 param setfor setting parameters atomically from the command line.