diff --git a/include/iri_action_server/iri_action_server.h b/include/iri_action_server/iri_action_server.h index d70ba47113ba42c00af296218c6d9a2a62038801..ed1c0b951c7cb60a073cc16de7d9a873d5023e46 100755 --- a/include/iri_action_server/iri_action_server.h +++ b/include/iri_action_server/iri_action_server.h @@ -212,7 +212,25 @@ class IriActionServer * then starts the simple action server. */ void start(void); - + + /** + * \brief Abort Action + * + * Calls the ROS simple action server to abort current action + * + * \param result An optional result to send back to any clients of the goal + * \param text An optional text message to send back to any clients of the goal + */ + void setAborted(const Result& result = Result(), const std::string& text = std::string("")); + + /** + * \brief Action is Active + * + * Allows polling implementations to query about the status of the current goal + * @return True if a goal is active, false otherwise + */ + bool isActive(void); + /** * \brief Set Loop Rate * @@ -318,6 +336,18 @@ void IriActionServer<ActionSpec>::start(void) ROS_FATAL("Some Callbacks have not been registered yet!"); } +template <class ActionSpec> +void IriActionServer<ActionSpec>::setAborted(const Result& result, const std::string& text) +{ + as_.setAborted(result, text); +} + +template <class ActionSpec> +bool IriActionServer<ActionSpec>::isActive(void) +{ + return as_.isActive(); +} + template <class ActionSpec> void IriActionServer<ActionSpec>::executeCallback(const GoalConstPtr& goal) {