Implement ros2 param check_sim_time verb#1193
Implement ros2 param check_sim_time verb#1193techtasie wants to merge 2 commits intoros2:rollingfrom
Conversation
Signed-off-by: Tim Wendt <techtasie@gmail.com>
Signed-off-by: Tim Wendt <techtasie@gmail.com>
fujitatomoya
left a comment
There was a problem hiding this comment.
@techtasie thanks for bringing up the real use case and PR !
do we already have this in rolling source build? which can be applied to any parameter instead of use_sim_time, that is much better.
root@tomoyafujita-B760M-Pro-RS-D4:~/ros2_ws/colcon_ws# ros2 param get use_sim_time
/launch_ros_720881:
Boolean value is: False
/lc_client:
Boolean value is: False
/lc_listener:
Boolean value is: False
/lc_talker:
Boolean value is: Falsebesides, i think this PR is not good precedent. we might end up having the other verbs like check_qos_override and so on including test cases. i do not think this is gonna scale that way... this eventually becomes the maintenance burden...
|
@fujitatomoya Oh, I didn’t know about But at least I found a bug in the current get-parameter helper: --- a/ros2param/ros2param/api/__init__.py
+++ b/ros2param/ros2param/api/__init__.py
@@ -74,14 +74,14 @@ def call_describe_parameters(*, node, node_name, parameter_names=None):
return response
-def call_get_parameters(*, node, node_name, parameter_names):
+def call_get_parameters(*, node, node_name, parameter_names, spin_timeout_sec=None):
client = AsyncParameterClient(node, node_name)
ready = client.wait_for_services(timeout_sec=5.0)
if not ready:
raise RuntimeError('Wait for service timed out waiting for '
f'parameter services for node {node_name}')
future = client.get_parameters(parameter_names)
- rclpy.spin_until_future_complete(node, future)
+ rclpy.spin_until_future_complete(node, future, timeout_sec=spin_timeout_sec)
response = future.result()
if response is None:
raise RuntimeError('Exception while calling service of node 'There should be a timeout for the service request; otherwise, hung/unresponsive nodes can prevent this from completing, this is only a real problem if you want to request the config from multiple nodes.. I will write up a patch for that. |
that i am trying to address with #1185? |
|
@fujitatomoya thanks! |
Description
Fixes #1192
Is this user-facing behavior change?
ros2 param check_sim_time is a new verb.
Did you use Generative AI?
GPT-5.2 was used to format the output and help generate the test.
Additional Information