rclcpp_action
master
C++ ROS Action Client Library
|
Class to interact with goals on a server. More...
#include <server_goal_handle.hpp>
Public Member Functions | |
void | publish_feedback (std::shared_ptr< typename ActionT::Feedback > feedback_msg) |
Send an update about the progress of a goal. More... | |
void | set_aborted (typename ActionT::Result::SharedPtr result_msg) |
Indicate that a goal could not be reached and has been aborted. More... | |
void | set_succeeded (typename ActionT::Result::SharedPtr result_msg) |
Indicate that a goal has been reached. More... | |
void | set_canceled (typename ActionT::Result::SharedPtr result_msg) |
Indicate that a goal has been canceled. More... | |
void | set_executing () |
Indicate that the server is starting to execute a goal. More... | |
const std::shared_ptr< const typename ActionT::Goal > | get_goal () const |
Get the original request message describing the goal. More... | |
const GoalID & | get_goal_id () const |
Get the unique identifier of the goal. More... | |
virtual | ~ServerGoalHandle () |
Public Member Functions inherited from rclcpp_action::ServerGoalHandleBase | |
RCLCPP_ACTION_PUBLIC bool | is_canceling () const |
RCLCPP_ACTION_PUBLIC bool | is_active () const |
RCLCPP_ACTION_PUBLIC bool | is_executing () const |
virtual RCLCPP_ACTION_PUBLIC | ~ServerGoalHandleBase () |
Protected Member Functions | |
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) | |
Protected Member Functions inherited from rclcpp_action::ServerGoalHandleBase | |
RCLCPP_ACTION_PUBLIC | ServerGoalHandleBase (std::shared_ptr< rcl_action_goal_handle_t > rcl_handle) |
RCLCPP_ACTION_PUBLIC void | _set_aborted () |
RCLCPP_ACTION_PUBLIC void | _set_succeeded () |
RCLCPP_ACTION_PUBLIC void | _set_canceling () |
RCLCPP_ACTION_PUBLIC void | _set_canceled () |
RCLCPP_ACTION_PUBLIC void | _set_executing () |
RCLCPP_ACTION_PUBLIC bool | try_canceling () noexcept |
Protected Attributes | |
const std::shared_ptr< const typename ActionT::Goal > | goal_ |
The original request message describing the goal. More... | |
const GoalID | uuid_ |
A unique id for the goal request. More... | |
friend | Server< ActionT > |
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_ |
Class to interact with goals on a server.
Use this class to check the status of a goal as well as set the result. This class is not meant to be created by a user, instead it is created when a goal has been accepted. The class rclcpp_action::Server<>
will create an instance and give it to the user in their handle_accepted
callback.
Internally, this class is responsible for coverting between the C++ action type and generic types for rclcpp_action::ServerGoalHandleBase
.
|
inlinevirtual |
|
inlineprotected |
|
inline |
Send an update about the progress of a goal.
This must only be called when the goal is executing. If execution of a goal is deferred then ServerGoalHandle<>::set_executing()
must be called first. std::runtime_error
is raised if the goal is in any state besides executing.
[in] | feedback_msg | the message to publish to clients. |
|
inline |
Indicate that a goal could not be reached and has been aborted.
Only call this if the goal was executing but cannot be completed. This is a terminal state, no more methods should be called on a goal handle after this is called. An exception is raised if the goal is in any state besides executing.
[in] | result_msg | the final result to send to clients. |
|
inline |
Indicate that a goal has been reached.
Only call this if the goal is executing and has reached the desired final state. This is a terminal state, no more methods should be called on a goal handle after this is called. An exception is raised if the goal is in any state besides executing.
[in] | result_msg | the final result to send to clients. |
|
inline |
Indicate that a goal has been canceled.
Only call this if the goal is executing or pending, but has been canceled. This is a terminal state, no more methods should be called on a goal handle after this is called. An exception is raised if the goal is in any state besides executing or pending.
[in] | result_msg | the final result to send to clients. |
|
inline |
Indicate that the server is starting to execute a goal.
Only call this if the goal is pending. An exception is raised if the goal is in any state besides pending.
|
inline |
Get the original request message describing the goal.
|
inline |
Get the unique identifier of the goal.
|
protected |
The original request message describing the goal.
|
protected |
A unique id for the goal request.
|
protected |
|
protected |
|
protected |
|
protected |