diff --git a/include/iri_action_server/iri_action_server.h b/include/iri_action_server/iri_action_server.h index 8c63784d03bd8ee6ee197a69b4abdc6028f2a681..023b778a4cca3775a5cb224646bc09b0906e9bbd 100755 --- a/include/iri_action_server/iri_action_server.h +++ b/include/iri_action_server/iri_action_server.h @@ -245,6 +245,16 @@ class IriActionServer */ void setAborted(const Result& result = Result(), const std::string& text = std::string("")); + /** + * \brief Preempt Action + * + * Calls the ROS simple action server to preempt 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 setPreempted(const Result& result = Result(), const std::string& text = std::string("")); + /** * \brief Action is Active * @@ -383,6 +393,12 @@ void IriActionServer<ActionSpec>::setAborted(const Result& result, const std::st as_.setAborted(result, text); } +template <class ActionSpec> +void IriActionServer<ActionSpec>::setPreempted(const Result& result, const std::string& text) +{ + as_.setPreempted(result, text); +} + template <class ActionSpec> bool IriActionServer<ActionSpec>::isActive(void) {