Feature: Async/await API for action clients - #15
Closed
iv461 wants to merge 31 commits into
Closed
Conversation
added 30 commits
January 28, 2026 16:36
… for timeout detection
… to the async await support for feedback: the feedback has to remain a callback, because otherwise we would need to buffer feedbacks received between the goal acceptance and the implicit feedback callback registration done by co_await feedback(). This buffering would be required to avoid a race.
…re it throws an exception if the action is already done.
…, because the async_goal_result API does not make sense. For this, we move the result promise inside the goalhandle, this leads to the goal handle not being copyable, so we return a shared pointer to the goal handle (like the original ROS API). I've also added three other useful methods from the GoalHandle base
…always launches an asynchronous operation, which in the case of actions API does not hold anymore
… the first action test passes
Owner
Author
|
Closing in favor of #17 that pathes rclcpp to solve the above issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress: an async/await-based API for action clients that supports the following:
I currently don't think I can finish this PR due to multiple bugs in
rclcppas well as the specification of the actions being implemented incorrectly:Deadlock occurs when chaining
send_goalrequests. This is caused by non-reentrant mutexes being held locked unnecessarily during user callbacks. This was fixed in the rolling version (async_send_goal deadlocks ros2/rclcpp#2796), but Tomoja Fujita says it won't be backported (async_send_goal deadlocks ros2/rclcpp#2796 (comment)). Unfortunately, this conceptual issue is present in many places inrclcpp.The specification of the actions protocol, more precisely the sequence diagrams, unambiguously specify that the server should only start sending feedback messages after the client has sent a result request. However, the current ROS implementation does not adhere to this specification. This standpoint is also shared by Janosch Machowinski (Status is Never Set to Executing if ros2 action rclcpp_action ros2/rclcpp#2782 (comment)).
It deviates from the specification by enabling the client to receive feedback messages before the result request has been sent.
This means a sensible async/await API such as:
would have a race condition, although it adheres to the specification. Feedback messages may be received before the
get_resultfunction is called, meaning they may be lost. This issue has been discussed here, and a fix has been proposed.send_goalandcancelrequests (similar to regular service calls) is missing. Currently, it is not possible to cancel callbacks or delete a pending goal request. If the server dies, the client leaks memory. This issue has not yet been resolved in the rolling version, as there is currently no way to delete items from thepimpl_->pending_goal_responsesmap added here. Fixing this may require a fix inrclMinor TODOs:
error: no suspend point info for ‘‘co_await’ not supported by dump_decl<declaration error>’ 134 | auto r2 = co_await f2;), for Humble