Templated base class for creating action executors for actionlib actions using SimpleActionClient. More...
#include <actionExecutorActionlib.hpp>
Public Member Functions | |
ActionExecutorActionlib () | |
virtual void | cancelAction () |
just cancelAllGoals | |
virtual bool | canExecute (const DurativeAction &a, const SymbolicState ¤t) const |
Determine if the action can be executed by this implementation. | |
virtual bool | executeBlocking (const DurativeAction &a, SymbolicState ¤t) |
Executes the action using SimpleActionClient. | |
virtual bool | fillGoal (ActionGoal &goal, const DurativeAction &a, const SymbolicState ¤t)=0 |
Fill the goal to execute this action. | |
virtual void | initialize (const std::deque< std::string > &arguments) |
Initialize the executor by creating the ActionClient. | |
virtual void | updateState (const actionlib::SimpleClientGoalState &actionReturnState, const ActionResult &result, const DurativeAction &a, SymbolicState ¤t) |
Update the state after an action was executed. | |
~ActionExecutorActionlib () | |
Protected Types | |
typedef actionlib::SimpleActionClient < Action > | ActionClient |
Protected Attributes | |
ActionClient * | _actionClient |
std::string | _actionName |
Templated base class for creating action executors for actionlib actions using SimpleActionClient.
The class is templated over the action (e.g. move_base_msgs::MoveBaseAction), the corresponding goal (e.g. move_base_msgs::MoveBaseGoal) and the matching result.
A minimal implementation should derive from this class (instantiating the template properly) and implement fillGoal.
canExecute can be overridden to test more specific than just the name. updateState can be used to update the planner state upon execution depending on the result of the execution.
Definition at line 21 of file actionExecutorActionlib.hpp.
typedef actionlib::SimpleActionClient<Action> ActionExecutorActionlib< Action, ActionGoal, ActionResult >::ActionClient [protected] |
Definition at line 66 of file actionExecutorActionlib.hpp.
ActionExecutorActionlib< Action, ActionGoal, ActionResult >::ActionExecutorActionlib | ( | ) |
Definition at line 74 of file actionExecutorActionlib.hpp.
ActionExecutorActionlib< Action, ActionGoal, ActionResult >::~ActionExecutorActionlib | ( | ) |
Definition at line 79 of file actionExecutorActionlib.hpp.
void ActionExecutorActionlib< Action, ActionGoal, ActionResult >::cancelAction | ( | ) | [virtual] |
just cancelAllGoals
Implements continual_planning_executive::ActionExecutorInterface.
Definition at line 139 of file actionExecutorActionlib.hpp.
bool ActionExecutorActionlib< Action, ActionGoal, ActionResult >::canExecute | ( | const DurativeAction & | a, |
const SymbolicState & | current | ||
) | const [virtual] |
Determine if the action can be executed by this implementation.
Default implementation only compares _actionName with the name of the DurativeAction.
Implements continual_planning_executive::ActionExecutorInterface.
Definition at line 106 of file actionExecutorActionlib.hpp.
bool ActionExecutorActionlib< Action, ActionGoal, ActionResult >::executeBlocking | ( | const DurativeAction & | a, |
SymbolicState & | current | ||
) | [virtual] |
Executes the action using SimpleActionClient.
Implements continual_planning_executive::ActionExecutorInterface.
Definition at line 113 of file actionExecutorActionlib.hpp.
virtual bool ActionExecutorActionlib< Action, ActionGoal, ActionResult >::fillGoal | ( | ActionGoal & | goal, |
const DurativeAction & | a, | ||
const SymbolicState & | current | ||
) | [pure virtual] |
Fill the goal to execute this action.
[out] | goal | the ActionGoal to be filled. |
[in] | a | the DurativeAction that is to be executed. |
[in] | current | the current state where a should be executd. |
void ActionExecutorActionlib< Action, ActionGoal, ActionResult >::initialize | ( | const std::deque< std::string > & | arguments | ) | [virtual] |
Initialize the executor by creating the ActionClient.
[in] | arguments | should be name of action (as in the plan), and the name of the action server to connect to, e.g. "driveBase move_base" |
Reimplemented from continual_planning_executive::ActionExecutorInterface.
Definition at line 88 of file actionExecutorActionlib.hpp.
virtual void ActionExecutorActionlib< Action, ActionGoal, ActionResult >::updateState | ( | const actionlib::SimpleClientGoalState & | actionReturnState, |
const ActionResult & | result, | ||
const DurativeAction & | a, | ||
SymbolicState & | current | ||
) | [inline, virtual] |
Update the state after an action was executed.
[in] | actionReturnState | the state of the executed action |
[in] | result | the result returned by the action |
[in,out] | current | the current planner state to be updated |
Definition at line 59 of file actionExecutorActionlib.hpp.
ActionClient* ActionExecutorActionlib< Action, ActionGoal, ActionResult >::_actionClient [protected] |
Definition at line 67 of file actionExecutorActionlib.hpp.
std::string ActionExecutorActionlib< Action, ActionGoal, ActionResult >::_actionName [protected] |
Definition at line 69 of file actionExecutorActionlib.hpp.