Skip to content

Implement ros2 param check_sim_time verb#1193

Closed
techtasie wants to merge 2 commits intoros2:rollingfrom
techtasie:rolling
Closed

Implement ros2 param check_sim_time verb#1193
techtasie wants to merge 2 commits intoros2:rollingfrom
techtasie:rolling

Conversation

@techtasie
Copy link

Description

Fixes #1192

Is this user-facing behavior change?

ros2 param check_sim_time is a new verb.

usage: ros2 param check_sim_time [-h] [--spin-time SPIN_TIME] [-s] [--no-daemon] [--include-hidden-nodes] [--per-node-timeout N]

Check for all node the use_sim_time parameter

options:
  -h, --help            show this help message and exit
  --spin-time SPIN_TIME
                        Spin time in seconds to wait for discovery (only applies when not using an already running daemon)
  -s, --use-sim-time    Enable ROS simulation time
  --no-daemon           Do not spawn nor use an already running daemon
  --include-hidden-nodes
                        Consider hidden nodes as well
  --per-node-timeout N  Maximum wait time per node for list_parameters service call in seconds (default: 5.0)

Did you use Generative AI?

GPT-5.2 was used to format the output and help generate the test.

Additional Information

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

see also https://docs.ros.org/en/rolling/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Parameters/Understanding-ROS2-Parameters.html#ros2-param-get

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: False

besides, 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...

@techtasie
Copy link
Author

techtasie commented Feb 18, 2026

@fujitatomoya Oh, I didn’t know about ros2 param get use_sim_time. Good to know!

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.

@fujitatomoya
Copy link
Collaborator

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

that i am trying to address with #1185?

@techtasie
Copy link
Author

@fujitatomoya thanks!

@techtasie techtasie closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ros2 param check_sim_time verb

2 participants