From f60c40c631b8735e32f91ef511679154c2772c86 Mon Sep 17 00:00:00 2001
From: Johannes Mey <johannes.mey@tu-dresden.de>
Date: Wed, 20 Jul 2022 18:40:08 +0200
Subject: [PATCH] move robot to default pose after finishing

---
 src/main/jastadd/cleanup/SemanticActions.jadd | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/main/jastadd/cleanup/SemanticActions.jadd b/src/main/jastadd/cleanup/SemanticActions.jadd
index 3c4e25b..981f176 100644
--- a/src/main/jastadd/cleanup/SemanticActions.jadd
+++ b/src/main/jastadd/cleanup/SemanticActions.jadd
@@ -59,6 +59,20 @@ aspect SemanticActions {
         }
     }
 
+    public void Tidy.action(World world) {
+        RobotScene scene = world.asRobotScene();
+        System.out.println("performing semantic action for element Tidy");
+        if (scene.simulated) {
+        } else {
+            de.tudresden.inf.st.ceti.Command c = de.tudresden.inf.st.ceti.Command.newBuilder().setEvacuate(de.tudresden.inf.st.ceti.Evacuate.newBuilder().setIdRobot("arm").setIdCollaborationZone("arm").build()).build();
+            try {
+                scene.connection.publish(scene.commandTopic, c.toByteArray(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
     public void Wait.action(World world) {
         RobotScene container = world.asRobotScene();
         System.out.println("performing semantic action for element Wait");
-- 
GitLab