37 #ifndef ACTIONLIB__SERVER__SIMPLE_ACTION_SERVER_H_ 38 #define ACTIONLIB__SERVER__SIMPLE_ACTION_SERVER_H_ 40 #include <boost/thread/condition.hpp> 59 template<
class ActionSpec>
124 ExecuteCallback execute_callback = NULL);
165 void setSucceeded(const Result & result = Result(), const
std::
string & text =
std::
string(""));
172 void setAborted(const Result & result = Result(), const
std::
string & text =
std::
string(""));
192 void setPreempted(const Result & result = Result(), const
std::
string & text =
std::
string(""));
256 #include <actionlib/server/simple_action_server_imp.h> 257 #endif // ACTIONLIB__SERVER__SIMPLE_ACTION_SERVER_H_ boost::shared_ptr< const Goal > acceptNewGoal()
Accepts a new goal when one is available. The status of this goal is set to active upon acceptance...
void publishFeedback(const FeedbackConstPtr &feedback)
Publishes feedback for a given goal.
boost::condition execute_condition_
boost::function< void()> goal_callback_
void preemptCallback(GoalHandle preempt)
Callback for when the ActionServer receives a new preempt and passes it on.
void goalCallback(GoalHandle goal)
Callback for when the ActionServer receives a new goal and passes it on.
void executeLoop()
Called from a separate thread to call blocking execute calls.
boost::mutex terminate_mutex_
boost::thread * execute_thread_
bool isActive()
Allows polling implementations to query about the status of the current goal.
void setSucceeded(const Result &result=Result(), const std::string &text=std::string(""))
Sets the status of the active goal to succeeded.
void shutdown()
Explicitly shutdown the action server.
boost::function< void(const GoalConstPtr &)> ExecuteCallback
void start()
Explicitly start the action server, used if auto_start is set to false.
void setPreempted(const Result &result=Result(), const std::string &text=std::string(""))
Sets the status of the active goal to preempted.
boost::function< void()> preempt_callback_
void registerPreemptCallback(boost::function< void()> cb)
Allows users to register a callback to be invoked when a new preempt request is available.
bool new_goal_preempt_request_
bool isPreemptRequested()
Allows polling implementations to query about preempt requests.
ExecuteCallback execute_callback_
#define ACTION_DEFINITION(ActionSpec)
void setAborted(const Result &result=Result(), const std::string &text=std::string(""))
Sets the status of the active goal to aborted.
ActionServer< TestAction >::GoalHandle GoalHandle
The ActionServer is a helpful tool for managing goal requests to a node. It allows the user to specif...
boost::shared_ptr< ActionServer< ActionSpec > > as_
void registerGoalCallback(boost::function< void()> cb)
Allows users to register a callback to be invoked when a new goal is available.
boost::recursive_mutex lock_
bool isNewGoalAvailable()
Allows polling implementations to query about the availability of a new goal.