From 6e8760cf7058623d827540f7e2a51a2920e40440 Mon Sep 17 00:00:00 2001 From: Joan Perez Ibarz <jperez@iri.upc.edu> Date: Fri, 21 Oct 2011 16:17:22 +0000 Subject: [PATCH] [iri_action_server] - adding preempt action to public API --- include/iri_action_server/iri_action_server.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/iri_action_server/iri_action_server.h b/include/iri_action_server/iri_action_server.h index 8c63784..023b778 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) { -- GitLab