-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature request
Feature description
Using the action client in rclcpp_action requires polling using timers on the future objects returned by Client::async_send_goal and Client::async_get_result. It would be far more convenient to add callbacks to these functions.
(spin_until_future_complete won't work because my node is already spinning.)
Implementation considerations
Possible function signatures could look like this:
using GoalResultCallback =
std::function<void(std::shared_future<typename GoalHandle::SharedPtr>)>;
using ResultCallback =
std::function<void(std::shared_future<Result>)>;
std::shared_future<typename GoalHandle::SharedPtr>
async_send_goal(
const Goal & goal, GoalResultCallback = nullptr,
FeedbackCallback callback = nullptr, ResultCallback = nullptr,
bool ignore_result = false);
std::shared_future<Result>
async_get_result(typename GoalHandle::SharedPtr goal_handle, ResultCallback = nullptr)
While these are the callbacks I currently need, it would be consistent to add appropriate callbacks to all functions returning future objects.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request