From 9266e66502e9b0c532673c1c35f7c4a6fb2cc58d Mon Sep 17 00:00:00 2001
From: Ernesto Corbellini <ecorbellini@ekumenlabs.com>
Date: Mon, 21 Dec 2015 18:03:42 -0300
Subject: [PATCH] Added a method to build the status message information.

---
 .../ekumen/rosjava_actionlib/ActionServer.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionServer.java b/src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionServer.java
index 1514840..a2fbed9 100644
--- a/src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionServer.java
+++ b/src/rosjava_actionlib/rosjava_actionlib/src/main/java/com/github/ekumen/rosjava_actionlib/ActionServer.java
@@ -314,6 +314,21 @@ public class ActionServer<T_ACTION_GOAL extends Message,
     }
   }
 
+  /**
+   * Set goal ID and state information to the goal status message.
+   * @param gstat GoalStatus message.
+   * @param gidString String identifying the goal.
+   * @see actionlib_msgs.GoalStatus
+   */
+  public void setGoalStatus(GoalStatus gstat, String gidString) {
+    try {
+      ServerGoal serverGoal = goalTracker.get(gidString);
+      gstat.setGoalId(getGoalId(serverGoal.goal));
+      gstat.setStatus((byte)serverGoal.state.getState());
+    }
+    catch (Exception e) {
+    }
+  }
   /**
   * Publishes the server's topics and suscribes to the client's topics.
   */
-- 
GitLab