The ActionServerBase implements the logic for an ActionServer. More...
#include <action_server_base.h>
Public Types | |
typedef ServerGoalHandle< ActionSpec > | GoalHandle |
Public Member Functions | |
ACTION_DEFINITION (ActionSpec) | |
ActionServerBase (boost::function< void(GoalHandle)> goal_cb, boost::function< void(GoalHandle)> cancel_cb, bool auto_start=false) | |
Constructor for an ActionServer. More... | |
void | cancelCallback (const boost::shared_ptr< const actionlib_msgs::GoalID > &goal_id) |
The ROS callback for cancel requests coming into the ActionServerBase. More... | |
void | goalCallback (const boost::shared_ptr< const ActionGoal > &goal) |
The ROS callback for goals coming into the ActionServerBase. More... | |
void | registerCancelCallback (boost::function< void(GoalHandle)> cb) |
Register a callback to be invoked when a new cancel is received, this will replace any previously registered callback. More... | |
void | registerGoalCallback (boost::function< void(GoalHandle)> cb) |
Register a callback to be invoked when a new goal is received, this will replace any previously registered callback. More... | |
void | start () |
Explicitly start the action server, used it auto_start is set to false. More... | |
virtual | ~ActionServerBase () |
Destructor for the ActionServerBase. More... | |
Protected Member Functions | |
virtual void | initialize ()=0 |
Initialize all ROS connections and setup timers. More... | |
virtual void | publishFeedback (const actionlib_msgs::GoalStatus &status, const Feedback &feedback)=0 |
Publishes feedback for a given goal. More... | |
virtual void | publishResult (const actionlib_msgs::GoalStatus &status, const Result &result)=0 |
Publishes a result for a given goal. More... | |
virtual void | publishStatus ()=0 |
Explicitly publish status. More... | |
Protected Attributes | |
boost::function< void(GoalHandle)> | cancel_callback_ |
boost::function< void(GoalHandle)> | goal_callback_ |
boost::shared_ptr< DestructionGuard > | guard_ |
GoalIDGenerator | id_generator_ |
ros::Time | last_cancel_ |
boost::recursive_mutex | lock_ |
bool | started_ |
std::list< StatusTracker< ActionSpec > > | status_list_ |
ros::Duration | status_list_timeout_ |
Friends | |
class | HandleTrackerDeleter< ActionSpec > |
class | ServerGoalHandle< ActionSpec > |
The ActionServerBase implements the logic for an ActionServer.
Definition at line 64 of file action_server_base.h.
typedef ServerGoalHandle<ActionSpec> actionlib::ActionServerBase< ActionSpec >::GoalHandle |
Definition at line 68 of file action_server_base.h.
actionlib::ActionServerBase< ActionSpec >::ActionServerBase | ( | boost::function< void(GoalHandle)> | goal_cb, |
boost::function< void(GoalHandle)> | cancel_cb, | ||
bool | auto_start = false |
||
) |
Constructor for an ActionServer.
goal_cb | A goal callback to be called when the ActionServer receives a new goal over the wire |
cancel_cb | A cancel callback to be called when the ActionServer receives a new cancel request over the wire |
auto_start | A boolean value that tells the ActionServer whether or not to start publishing as soon as it comes up. THIS SHOULD ALWAYS BE SET TO FALSE TO AVOID RACE CONDITIONS and start() should be called after construction of the server. |
Definition at line 164 of file action_server_base.h.
|
virtual |
Destructor for the ActionServerBase.
Definition at line 176 of file action_server_base.h.
actionlib::ActionServerBase< ActionSpec >::ACTION_DEFINITION | ( | ActionSpec | ) |
void actionlib::ActionServerBase< ActionSpec >::cancelCallback | ( | const boost::shared_ptr< const actionlib_msgs::GoalID > & | goal_id | ) |
The ROS callback for cancel requests coming into the ActionServerBase.
Definition at line 265 of file action_server_base.h.
void actionlib::ActionServerBase< ActionSpec >::goalCallback | ( | const boost::shared_ptr< const ActionGoal > & | goal | ) |
The ROS callback for goals coming into the ActionServerBase.
Definition at line 204 of file action_server_base.h.
|
protectedpure virtual |
Initialize all ROS connections and setup timers.
Implemented in actionlib::ActionServer< ActionSpec >, and actionlib::ActionServer< TestAction >.
|
protectedpure virtual |
Publishes feedback for a given goal.
status | The status of the goal with which the feedback is associated |
feedback | The feedback to publish |
Implemented in actionlib::ActionServer< ActionSpec >, and actionlib::ActionServer< TestAction >.
|
protectedpure virtual |
Publishes a result for a given goal.
status | The status of the goal with which the result is associated |
result | The result to publish |
Implemented in actionlib::ActionServer< ActionSpec >, and actionlib::ActionServer< TestAction >.
|
protectedpure virtual |
Explicitly publish status.
Implemented in actionlib::ActionServer< ActionSpec >, and actionlib::ActionServer< TestAction >.
void actionlib::ActionServerBase< ActionSpec >::registerCancelCallback | ( | boost::function< void(GoalHandle)> | cb | ) |
Register a callback to be invoked when a new cancel is received, this will replace any previously registered callback.
cb | The callback to invoke |
Definition at line 189 of file action_server_base.h.
void actionlib::ActionServerBase< ActionSpec >::registerGoalCallback | ( | boost::function< void(GoalHandle)> | cb | ) |
Register a callback to be invoked when a new goal is received, this will replace any previously registered callback.
cb | The callback to invoke |
Definition at line 183 of file action_server_base.h.
void actionlib::ActionServerBase< ActionSpec >::start | ( | ) |
Explicitly start the action server, used it auto_start is set to false.
Definition at line 195 of file action_server_base.h.
|
friend |
Definition at line 121 of file action_server_base.h.
|
friend |
Definition at line 120 of file action_server_base.h.
|
protected |
Definition at line 153 of file action_server_base.h.
|
protected |
Definition at line 152 of file action_server_base.h.
|
protected |
Definition at line 160 of file action_server_base.h.
|
protected |
Definition at line 158 of file action_server_base.h.
|
protected |
Definition at line 155 of file action_server_base.h.
|
protected |
Definition at line 148 of file action_server_base.h.
|
protected |
Definition at line 159 of file action_server_base.h.
|
protected |
Definition at line 150 of file action_server_base.h.
|
protected |
Definition at line 156 of file action_server_base.h.