15 #ifndef RCLCPP_ACTION__SERVER_GOAL_HANDLE_HPP_ 16 #define RCLCPP_ACTION__SERVER_GOAL_HANDLE_HPP_ 21 #include <action_msgs/msg/goal_status.hpp> 76 : rcl_handle_(rcl_handle)
120 template<
typename ActionT>
134 template<
typename ActionT>
150 feedback_msg->action_goal_id.uuid = uuid_;
151 publish_feedback_(feedback_msg);
168 result_msg->action_status = action_msgs::msg::GoalStatus::STATUS_ABORTED;
169 on_terminal_state_(uuid_, result_msg);
185 result_msg->action_status = action_msgs::msg::GoalStatus::STATUS_SUCCEEDED;
186 on_terminal_state_(uuid_, result_msg);
202 result_msg->action_status = action_msgs::msg::GoalStatus::STATUS_CANCELED;
203 on_terminal_state_(uuid_, result_msg);
215 on_executing_(uuid_);
236 auto null_result = std::make_shared<typename ActionT::Result>();
237 null_result->action_status = action_msgs::msg::GoalStatus::STATUS_CANCELED;
238 on_terminal_state_(uuid_, null_result);
253 on_terminal_state_(on_terminal_state), on_executing_(on_executing),
254 publish_feedback_(publish_feedback)
272 #endif // RCLCPP_ACTION__SERVER_GOAL_HANDLE_HPP_
RCLCPP_ACTION_PUBLIC ServerGoalHandleBase(std::shared_ptr< rcl_action_goal_handle_t > rcl_handle)
Definition: server_goal_handle.hpp:73
RCLCPP_ACTION_PUBLIC bool is_canceling() const
void set_succeeded(typename ActionT::Result::SharedPtr result_msg)
Indicate that a goal has been reached.
Definition: server_goal_handle.hpp:182
const std::shared_ptr< const typename ActionT::Goal > get_goal() const
Get the original request message describing the goal.
Definition: server_goal_handle.hpp:220
RCLCPP_ACTION_PUBLIC bool try_canceling() noexcept
Definition: server_goal_handle.hpp:42
const GoalID uuid_
A unique id for the goal request.
Definition: server_goal_handle.hpp:262
RCLCPP_ACTION_PUBLIC void _set_executing()
Action Server.
Definition: server.hpp:268
Class to interact with goals on a server.
Definition: server_goal_handle.hpp:135
void set_canceled(typename ActionT::Result::SharedPtr result_msg)
Indicate that a goal has been canceled.
Definition: server_goal_handle.hpp:199
void set_executing()
Indicate that the server is starting to execute a goal.
Definition: server_goal_handle.hpp:212
virtual RCLCPP_ACTION_PUBLIC ~ServerGoalHandleBase()
const std::shared_ptr< const typename ActionT::Goal > goal_
The original request message describing the goal.
Definition: server_goal_handle.hpp:259
virtual ~ServerGoalHandle()
Definition: server_goal_handle.hpp:232
#define RCLCPP_ACTION_PUBLIC
Definition: visibility_control.hpp:50
RCLCPP_ACTION_PUBLIC void _set_canceled()
RCLCPP_ACTION_PUBLIC void _set_succeeded()
Definition: client.hpp:44
std::function< void(const GoalID &)> on_executing_
Definition: server_goal_handle.hpp:267
void set_aborted(typename ActionT::Result::SharedPtr result_msg)
Indicate that a goal could not be reached and has been aborted.
Definition: server_goal_handle.hpp:165
ServerGoalHandle(std::shared_ptr< rcl_action_goal_handle_t > rcl_handle, GoalID uuid, std::shared_ptr< const typename ActionT::Goal > goal, std::function< void(const GoalID &, std::shared_ptr< void >)> on_terminal_state, std::function< void(const GoalID &)> on_executing, std::function< void(std::shared_ptr< typename ActionT::Feedback >)> publish_feedback)
Definition: server_goal_handle.hpp:244
void publish_feedback(std::shared_ptr< typename ActionT::Feedback > feedback_msg)
Send an update about the progress of a goal.
Definition: server_goal_handle.hpp:148
RCLCPP_ACTION_PUBLIC void _set_aborted()
const GoalID & get_goal_id() const
Get the unique identifier of the goal.
Definition: server_goal_handle.hpp:227
RCLCPP_ACTION_PUBLIC bool is_executing() const
RCLCPP_ACTION_PUBLIC void _set_canceling()
RCLCPP_ACTION_PUBLIC bool is_active() const