You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ROS 2 action is a combination of several topics and services.
There is a service called "action_name" + /_action/get_result, which will reply the result of ROS 2 action.
In the ROS 2 action popular example fibonacci_action, it will run about 10 sec, but the default timeout of querier is 5 sec.
The question of the default timeout value for Services and Actions calls is a tricky one, as ROS 2 doesn't manage any timeout on such calls. But a timeout is required for any Zenoh queries.
I think that in 5 seconds is already large for all the Service calls. Only Actions might take longer (for instance a mission to make a robot to follow a navigation path can take several minutes or even hours).
The design of an Action is actually asynchronous with 2 distinct Services calls:
_action/send_goal to initialise the action - the Action Server shall quickly reply either accepting or rejecting the goal
_action/get_result to get the result - if this is called only once the action succeeded, the reply will be quick. Otherwise the service call is blocking.
The problem with the current implementation of Action Client in rclcpp is that if a result_callback is passed in when calling async_send_goal() the GoalHandle is made result_aware and the _action/get_result service is directly called, without waiting the goal to finish. Hence the timeout on long actions.
Anyway, I think the default timeout for all Service calls must be kept relatively small for a "failfast" behaviour, especially at launch time where detecting a unresponsive Service is important. 5 seconds is appropriate in my opinion.
However I agree we can increase the default timeout for Actions' get_result. But what's the appropriate timeout for most of the Actions ? 30 seconds ? 5 minutes ? 1 hour ?
I agree with you that we should only increase the default timeout for get_result. 5 seconds should fit most of the scenarios for ROS 2 service. Regarding the appropriate timeout, perhaps we can set 30 seconds for the time being. At least this can make the example work and not confuse users.
Besides this, a warning on the timeout might be a good plus for users to know what happened.
Describe the bug
ROS 2 action is a combination of several topics and services.
There is a service called "action_name" +
/_action/get_result
, which will reply the result of ROS 2 action.In the ROS 2 action popular example
fibonacci_action
, it will run about 10 sec, but the default timeout of querier is 5 sec.zenoh-plugin-ros2dds/DEFAULT_CONFIG.json5
Line 136 in de8acf5
This will cause the action client example keep waiting and never finish.
I think we can do both:
To reproduce
System info
The text was updated successfully, but these errors were encountered: