Addition of a ``wait_for_node()`` function
Feature request
Feature description
It would be nice to have a wait_for_node(node_name, timeout) function which would wait for a particular node to show up, and block for a specified time. Further, we can have a set of wait_for_* functions which could wait for parameters, services, topics to show up.
Implementation considerations
This feature was mentioned in https://github.com/ros2/launch_ros/pull/263.
Related feature exists in rcl (https://github.com/ros2/rcl/pull/907) but it hasn't been ported to rclcpp (https://github.com/ros2/rclcpp/pull/1621) due to a design issue.
+1 for a function like this, but if I understand correctly, ros2/rcl#907 looks for publisher/subscriber counts on a named topic, right? Which is close enough in spirit, but I guess that isn't the API this issue would want to have wrapped in rclpy.
Right. The implementation I have in https://github.com/ros2/launch_ros/pull/263 is pretty basic, and definitely not efficient. Not sure where to implement this feature though, maybe in rcl and then wrap it in rclpy and rclcpp
maybe in
rcland then wrap it inrclpyandrclcpp
I think that's the way to go because I see utility for all of the wait_for_* methods in the client libraries.
A basic implementation is added here : https://github.com/ros2/examples/blob/200a16c2290e09a26eaa91f201555887cbb3e379/launch_testing/launch_testing_examples/launch_testing_examples/check_multiple_nodes_launch_test.py#L84
FYI I think this has been closed by https://github.com/ros2/rclpy/pull/930! That has been released into Iron (not backported into Humble AFAICT)
Good call. I'll go ahead and close this one out, thanks!