Public Types | Public Member Functions | Private Member Functions | Private Attributes
actionlib::ActionServer< ActionSpec > Class Template Reference

The ActionServer is a helpful tool for managing goal requests to a node. It allows the user to specify callbacks that are invoked when goal or cancel requests come over the wire, and passes back GoalHandles that can be used to track the state of a given goal request. The ActionServer makes no assumptions about the policy used to service these goals, and sends status for each goal over the wire until the last GoalHandle associated with a goal request is destroyed. More...

#include <action_server.h>

Inheritance diagram for actionlib::ActionServer< ActionSpec >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef ServerGoalHandle
< ActionSpec > 
GoalHandle

Public Member Functions

 ACTION_DEFINITION (ActionSpec)
 ActionServer (ros::NodeHandle n, std::string name, boost::function< void(GoalHandle)> goal_cb, boost::function< void(GoalHandle)> cancel_cb, bool auto_start)
 Constructor for an ActionServer.
 ActionServer (ros::NodeHandle n, std::string name, boost::function< void(GoalHandle)> goal_cb, bool auto_start)
 Constructor for an ActionServer.
ROS_DEPRECATED ActionServer (ros::NodeHandle n, std::string name, boost::function< void(GoalHandle)> goal_cb, boost::function< void(GoalHandle)> cancel_cb=boost::function< void(GoalHandle)>())
 DEPRECATED Constructor for an ActionServer.
 ActionServer (ros::NodeHandle n, std::string name, bool auto_start)
 Constructor for an ActionServer.
ROS_DEPRECATED ActionServer (ros::NodeHandle n, std::string name)
 DEPRECATED Constructor for an ActionServer.
virtual ~ActionServer ()
 Destructor for the ActionServer.

Private Member Functions

virtual void initialize ()
 Initialize all ROS connections and setup timers.
virtual void publishFeedback (const actionlib_msgs::GoalStatus &status, const Feedback &feedback)
 Publishes feedback for a given goal.
virtual void publishResult (const actionlib_msgs::GoalStatus &status, const Result &result)
 Publishes a result for a given goal.
virtual void publishStatus ()
 Explicitly publish status.
void publishStatus (const ros::TimerEvent &e)
 Publish status for all goals on a timer event.

Private Attributes

ros::Subscriber cancel_sub_
ros::Publisher feedback_pub_
ros::Subscriber goal_sub_
ros::NodeHandle node_
ros::Publisher result_pub_
ros::Publisher status_pub_
ros::Timer status_timer_

Detailed Description

template<class ActionSpec>
class actionlib::ActionServer< ActionSpec >

The ActionServer is a helpful tool for managing goal requests to a node. It allows the user to specify callbacks that are invoked when goal or cancel requests come over the wire, and passes back GoalHandles that can be used to track the state of a given goal request. The ActionServer makes no assumptions about the policy used to service these goals, and sends status for each goal over the wire until the last GoalHandle associated with a goal request is destroyed.

Definition at line 72 of file action_server.h.


Member Typedef Documentation

template<class ActionSpec>
typedef ServerGoalHandle<ActionSpec> actionlib::ActionServer< ActionSpec >::GoalHandle

Reimplemented from actionlib::ActionServerBase< ActionSpec >.

Reimplemented in actionlib::RefServer.

Definition at line 76 of file action_server.h.


Constructor & Destructor Documentation

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::ActionServer ( ros::NodeHandle  n,
std::string  name,
boost::function< void(GoalHandle)>  goal_cb,
boost::function< void(GoalHandle)>  cancel_cb,
bool  auto_start 
)

Constructor for an ActionServer.

Parameters:
nA NodeHandle to create a namespace under
nameThe name of the action
goal_cbA goal callback to be called when the ActionServer receives a new goal over the wire
cancel_cbA cancel callback to be called when the ActionServer receives a new cancel request over the wire
auto_startA 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 80 of file action_server_imp.h.

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::ActionServer ( ros::NodeHandle  n,
std::string  name,
boost::function< void(GoalHandle)>  goal_cb,
bool  auto_start 
)

Constructor for an ActionServer.

Parameters:
nA NodeHandle to create a namespace under
nameThe name of the action
goal_cbA goal callback to be called when the ActionServer receives a new goal over the wire
auto_startA 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 115 of file action_server_imp.h.

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::ActionServer ( ros::NodeHandle  n,
std::string  name,
boost::function< void(GoalHandle)>  goal_cb,
boost::function< void(GoalHandle)>  cancel_cb = boost::function<void(GoalHandle)>() 
)

DEPRECATED Constructor for an ActionServer.

Parameters:
nA NodeHandle to create a namespace under
nameThe name of the action
goal_cbA goal callback to be called when the ActionServer receives a new goal over the wire
cancel_cbA cancel callback to be called when the ActionServer receives a new cancel request over the wire

Definition at line 98 of file action_server_imp.h.

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::ActionServer ( ros::NodeHandle  n,
std::string  name,
bool  auto_start 
)

Constructor for an ActionServer.

Parameters:
nA NodeHandle to create a namespace under
nameThe name of the action
auto_startA 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 47 of file action_server_imp.h.

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::ActionServer ( ros::NodeHandle  n,
std::string  name 
)

DEPRECATED Constructor for an ActionServer.

Parameters:
nA NodeHandle to create a namespace under
nameThe name of the action

Definition at line 64 of file action_server_imp.h.

template<class ActionSpec >
actionlib::ActionServer< ActionSpec >::~ActionServer ( ) [virtual]

Destructor for the ActionServer.

Definition at line 132 of file action_server_imp.h.


Member Function Documentation

template<class ActionSpec>
actionlib::ActionServer< ActionSpec >::ACTION_DEFINITION ( ActionSpec  )
template<class ActionSpec >
void actionlib::ActionServer< ActionSpec >::initialize ( ) [private, virtual]

Initialize all ROS connections and setup timers.

Implements actionlib::ActionServerBase< ActionSpec >.

Definition at line 137 of file action_server_imp.h.

template<class ActionSpec >
void actionlib::ActionServer< ActionSpec >::publishFeedback ( const actionlib_msgs::GoalStatus &  status,
const Feedback &  feedback 
) [private, virtual]

Publishes feedback for a given goal.

Parameters:
statusThe status of the goal with which the feedback is associated
feedbackThe feedback to publish

Implements actionlib::ActionServerBase< ActionSpec >.

Definition at line 203 of file action_server_imp.h.

template<class ActionSpec >
void actionlib::ActionServer< ActionSpec >::publishResult ( const actionlib_msgs::GoalStatus &  status,
const Result &  result 
) [private, virtual]

Publishes a result for a given goal.

Parameters:
statusThe status of the goal with which the result is associated
resultThe result to publish

Implements actionlib::ActionServerBase< ActionSpec >.

Definition at line 187 of file action_server_imp.h.

template<class ActionSpec >
void actionlib::ActionServer< ActionSpec >::publishStatus ( ) [private, virtual]

Explicitly publish status.

Implements actionlib::ActionServerBase< ActionSpec >.

Definition at line 230 of file action_server_imp.h.

template<class ActionSpec >
void actionlib::ActionServer< ActionSpec >::publishStatus ( const ros::TimerEvent e) [private]

Publish status for all goals on a timer event.

Definition at line 218 of file action_server_imp.h.


Member Data Documentation

template<class ActionSpec>
ros::Subscriber actionlib::ActionServer< ActionSpec >::cancel_sub_ [private]

Definition at line 170 of file action_server.h.

template<class ActionSpec>
ros::Publisher actionlib::ActionServer< ActionSpec >::feedback_pub_ [private]

Definition at line 171 of file action_server.h.

template<class ActionSpec>
ros::Subscriber actionlib::ActionServer< ActionSpec >::goal_sub_ [private]

Definition at line 170 of file action_server.h.

template<class ActionSpec>
ros::NodeHandle actionlib::ActionServer< ActionSpec >::node_ [private]

Definition at line 168 of file action_server.h.

template<class ActionSpec>
ros::Publisher actionlib::ActionServer< ActionSpec >::result_pub_ [private]

Definition at line 171 of file action_server.h.

template<class ActionSpec>
ros::Publisher actionlib::ActionServer< ActionSpec >::status_pub_ [private]

Definition at line 171 of file action_server.h.

template<class ActionSpec>
ros::Timer actionlib::ActionServer< ActionSpec >::status_timer_ [private]

Definition at line 173 of file action_server.h.


The documentation for this class was generated from the following files:


actionlib
Author(s): Eitan Marder-Eppstein, Vijay Pradeep, Mikael Arguedas
autogenerated on Sat Feb 16 2019 03:21:29