Encapsulates a state machine for a given goal that the user can trigger transitions on. All ROS interfaces for the goal are managed by the ActionServer to lessen the burden on the user. More...
#include <server_goal_handle.h>
Public Member Functions | |
boost::shared_ptr< const Goal > | getGoal () const |
Accessor for the goal associated with the ServerGoalHandle. More... | |
actionlib_msgs::GoalID | getGoalID () const |
Accessor for the goal id associated with the ServerGoalHandle. More... | |
actionlib_msgs::GoalStatus | getGoalStatus () const |
Accessor for the status associated with the ServerGoalHandle. More... | |
bool | isValid () const |
Determine if the goal handle is valid (tracking a valid goal, and associated with a valid action server). If the handle is valid, it means that the accessors getGoal, getGoalID, etc, can be called without generating errors. More... | |
bool | operator!= (const ServerGoalHandle &other) const |
!= operator for ServerGoalHandles More... | |
ServerGoalHandle & | operator= (const ServerGoalHandle &gh) |
Equals operator for a ServerGoalHandle. More... | |
bool | operator== (const ServerGoalHandle &other) const |
Equals operator for ServerGoalHandles. More... | |
void | publishFeedback (const Feedback &feedback) |
Send feedback to any clients of the goal associated with this ServerGoalHandle. More... | |
ServerGoalHandle () | |
Default constructor for a ServerGoalHandle. More... | |
ServerGoalHandle (const ServerGoalHandle &gh) | |
Copy constructor for a ServerGoalHandle. More... | |
void | setAborted (const Result &result=Result(), const std::string &text=std::string("")) |
Set the status of the goal associated with the ServerGoalHandle to aborted. More... | |
void | setAccepted (const std::string &text=std::string("")) |
Accept the goal referenced by the goal handle. This will transition to the ACTIVE state or the PREEMPTING state depending on whether a cancel request has been received for the goal. More... | |
void | setCanceled (const Result &result=Result(), const std::string &text=std::string("")) |
Set the status of the goal associated with the ServerGoalHandle to RECALLED or PREEMPTED depending on what the current status of the goal is. More... | |
void | setRejected (const Result &result=Result(), const std::string &text=std::string("")) |
Set the status of the goal associated with the ServerGoalHandle to rejected. More... | |
void | setSucceeded (const Result &result=Result(), const std::string &text=std::string("")) |
Set the status of the goal associated with the ServerGoalHandle to succeeded. More... | |
Private Member Functions | |
ServerGoalHandle (typename std::list< StatusTracker< ActionSpec > >::iterator status_it, ActionServerBase< ActionSpec > *as, boost::shared_ptr< void > handle_tracker, boost::shared_ptr< DestructionGuard > guard) | |
A private constructor used by the ActionServer to initialize a ServerGoalHandle. More... | |
bool | setCancelRequested () |
A private method to set status to PENDING or RECALLING. More... | |
Private Attributes | |
ActionServerBase< ActionSpec > * | as_ |
boost::shared_ptr< const ActionGoal > | goal_ |
boost::shared_ptr< DestructionGuard > | guard_ |
boost::shared_ptr< void > | handle_tracker_ |
std::list< StatusTracker< ActionSpec > >::iterator | status_it_ |
Friends | |
class | ActionServerBase< ActionSpec > |
Encapsulates a state machine for a given goal that the user can trigger transitions on. All ROS interfaces for the goal are managed by the ActionServer to lessen the burden on the user.
Definition at line 63 of file server_goal_handle.h.
actionlib::ServerGoalHandle< ActionSpec >::ServerGoalHandle | ( | ) |
Default constructor for a ServerGoalHandle.
Definition at line 48 of file server_goal_handle_imp.h.
actionlib::ServerGoalHandle< ActionSpec >::ServerGoalHandle | ( | const ServerGoalHandle< ActionSpec > & | gh | ) |
Copy constructor for a ServerGoalHandle.
gh | The goal handle to copy |
Definition at line 52 of file server_goal_handle_imp.h.
|
private |
A private constructor used by the ActionServer to initialize a ServerGoalHandle.
Definition at line 373 of file server_goal_handle_imp.h.
boost::shared_ptr< const typename ServerGoalHandle< ActionSpec >::Goal > actionlib::ServerGoalHandle< ActionSpec >::getGoal | ( | ) | const |
Accessor for the goal associated with the ServerGoalHandle.
Definition at line 292 of file server_goal_handle_imp.h.
actionlib_msgs::GoalID actionlib::ServerGoalHandle< ActionSpec >::getGoalID | ( | ) | const |
Accessor for the goal id associated with the ServerGoalHandle.
Definition at line 304 of file server_goal_handle_imp.h.
actionlib_msgs::GoalStatus actionlib::ServerGoalHandle< ActionSpec >::getGoalStatus | ( | ) | const |
Accessor for the status associated with the ServerGoalHandle.
Definition at line 322 of file server_goal_handle_imp.h.
bool actionlib::ServerGoalHandle< ActionSpec >::isValid | ( | ) | const |
Determine if the goal handle is valid (tracking a valid goal, and associated with a valid action server). If the handle is valid, it means that the accessors getGoal, getGoalID, etc, can be called without generating errors.
Definition at line 285 of file server_goal_handle_imp.h.
bool actionlib::ServerGoalHandle< ActionSpec >::operator!= | ( | const ServerGoalHandle< ActionSpec > & | other | ) | const |
!= operator for ServerGoalHandles
other | The ServerGoalHandle to compare to |
Definition at line 367 of file server_goal_handle_imp.h.
ServerGoalHandle< ActionSpec > & actionlib::ServerGoalHandle< ActionSpec >::operator= | ( | const ServerGoalHandle< ActionSpec > & | gh | ) |
Equals operator for a ServerGoalHandle.
gh | The goal handle to copy |
Definition at line 340 of file server_goal_handle_imp.h.
bool actionlib::ServerGoalHandle< ActionSpec >::operator== | ( | const ServerGoalHandle< ActionSpec > & | other | ) | const |
Equals operator for ServerGoalHandles.
other | The ServerGoalHandle to compare to |
Definition at line 351 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::publishFeedback | ( | const Feedback & | feedback | ) |
Send feedback to any clients of the goal associated with this ServerGoalHandle.
feedback | The feedback to send to the client |
Definition at line 257 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::setAborted | ( | const Result & | result = Result() , |
const std::string & | text = std::string("") |
||
) |
Set the status of the goal associated with the ServerGoalHandle to aborted.
result | Optionally, the user can pass in a result to be sent to any clients of the goal |
text | Optionally, any text message about the status change being made that should be passed to the client |
Definition at line 181 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::setAccepted | ( | const std::string & | text = std::string("") | ) |
Accept the goal referenced by the goal handle. This will transition to the ACTIVE state or the PREEMPTING state depending on whether a cancel request has been received for the goal.
text | Optionally, any text message about the status change being made that should be passed to the client |
Definition at line 57 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::setCanceled | ( | const Result & | result = Result() , |
const std::string & | text = std::string("") |
||
) |
Set the status of the goal associated with the ServerGoalHandle to RECALLED or PREEMPTED depending on what the current status of the goal is.
result | Optionally, the user can pass in a result to be sent to any clients of the goal |
text | Optionally, any text message about the status change being made that should be passed to the client |
Definition at line 100 of file server_goal_handle_imp.h.
|
private |
A private method to set status to PENDING or RECALLING.
Definition at line 381 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::setRejected | ( | const Result & | result = Result() , |
const std::string & | text = std::string("") |
||
) |
Set the status of the goal associated with the ServerGoalHandle to rejected.
result | Optionally, the user can pass in a result to be sent to any clients of the goal |
text | Optionally, any text message about the status change being made that should be passed to the client |
Definition at line 143 of file server_goal_handle_imp.h.
void actionlib::ServerGoalHandle< ActionSpec >::setSucceeded | ( | const Result & | result = Result() , |
const std::string & | text = std::string("") |
||
) |
Set the status of the goal associated with the ServerGoalHandle to succeeded.
result | Optionally, the user can pass in a result to be sent to any clients of the goal |
text | Optionally, any text message about the status change being made that should be passed to the client |
Definition at line 219 of file server_goal_handle_imp.h.
|
friend |
Definition at line 190 of file server_goal_handle.h.
|
private |
Definition at line 187 of file server_goal_handle.h.
|
private |
Definition at line 186 of file server_goal_handle.h.
|
private |
Definition at line 189 of file server_goal_handle.h.
|
private |
Definition at line 188 of file server_goal_handle.h.
|
private |
Definition at line 185 of file server_goal_handle.h.