15 #ifndef RCLCPP_ACTION__CLIENT_GOAL_HANDLE_IMPL_HPP_ 16 #define RCLCPP_ACTION__CLIENT_GOAL_HANDLE_IMPL_HPP_ 29 template<
typename ActionT>
30 ClientGoalHandle<ActionT>::ClientGoalHandle(
31 const GoalInfo & info, FeedbackCallback feedback_callback, ResultCallback result_callback)
33 result_future_(result_promise_.get_future()),
34 feedback_callback_(feedback_callback),
35 result_callback_(result_callback)
39 template<
typename ActionT>
44 template<
typename ActionT>
48 return info_.goal_id.uuid;
51 template<
typename ActionT>
58 template<
typename ActionT>
63 if (!is_result_aware_) {
66 return result_future_;
69 template<
typename ActionT>
74 status_ =
static_cast<int8_t
>(wrapped_result.
code);
75 result_promise_.set_value(wrapped_result);
76 if (result_callback_) {
77 result_callback_(wrapped_result);
81 template<
typename ActionT>
86 feedback_callback_ = callback;
89 template<
typename ActionT>
94 result_callback_ = callback;
97 template<
typename ActionT>
105 template<
typename ActionT>
113 template<
typename ActionT>
118 return feedback_callback_ !=
nullptr;
121 template<
typename ActionT>
126 return is_result_aware_;
129 template<
typename ActionT>
134 bool previous = is_result_aware_;
135 is_result_aware_ = awareness;
139 template<
typename ActionT>
144 status_ = GoalStatus::STATUS_UNKNOWN;
148 template<
typename ActionT>
154 if (shared_this.get() !=
this) {
159 if (
nullptr == feedback_callback_) {
164 feedback_callback_(shared_this, feedback_message);
169 #endif // RCLCPP_ACTION__CLIENT_GOAL_HANDLE_IMPL_HPP_
Definition: client_goal_handle.hpp:64
T make_exception_ptr(T... args)
int8_t get_status()
Get the goal status code.
Definition: client_goal_handle_impl.hpp:99
Logger get_logger(const std::string &name)
virtual ~ClientGoalHandle()
Definition: client_goal_handle_impl.hpp:40
bool is_result_aware()
Check if an action client has requested the result for the goal.
Definition: client_goal_handle_impl.hpp:123
const GoalUUID & get_goal_id() const
Get the unique ID for the goal.
Definition: client_goal_handle_impl.hpp:46
#define RCLCPP_DEBUG(logger,...)
#define RCLCPP_ERROR(logger,...)
rclcpp::Time get_goal_stamp() const
Get the time when the goal was accepted.
Definition: client_goal_handle_impl.hpp:53
ResultCode code
A status to indicate if the goal was canceled, aborted, or suceeded.
Definition: client_goal_handle.hpp:69
action_msgs::msg::GoalInfo GoalInfo
Definition: types.hpp:34
Definition: client.hpp:44
Definition: exceptions.hpp:33
Class for interacting with goals sent from action clients.
Definition: client_goal_handle.hpp:58
std::shared_future< WrappedResult > async_result()
Get a future to the goal result.
Definition: client_goal_handle_impl.hpp:60
bool is_feedback_aware()
Check if an action client has subscribed to feedback for the goal.
Definition: client_goal_handle_impl.hpp:115