ros-visualization / rqt_reconfigure

http://wiki.ros.org/rqt_reconfigure
Other
23 stars 50 forks source link

Use timeouts in service calls to avoid hangs #98

Closed mjeronimo closed 3 years ago

mjeronimo commented 3 years ago

Don't assume that all ROS nodes support the parameter services. Instead explicitly look for the ListParameters service.

Also, don't assume that all nodes are spinning. Instead of using synchronous service calls (which don't allow for a timeout and will hang if the node is not spinning to process its messages) using an async call, which returns a future that can be used with rclpy.spin_until_future_complete, which supports a timeout.

Note: Parameters can be dynamically added to a node. So, nodes that support the parameter services but currently don't have any parameters could have parameters in the future (currently, all nodes support at least use_sim_time) . So, the presence of the ListParameters service is used as evidence that a node has/can have parameters (since this is used to populate the list of nodes upon a refresh of the node list).

Fixes #97, fixes #96, fixes #64

Signed-off-by: Michael Jeronimo michael.jeronimo@openrobotics.org