Skip to content
Snippets Groups Projects
Commit 184df02f authored by Johannes Mey's avatar Johannes Mey
Browse files

improve demo execution on real robot

parent cbe02b3b
No related branches found
No related tags found
No related merge requests found
Pipeline #14153 failed
This diff is collapsed.
...@@ -15,6 +15,7 @@ aspect CleanupAttributes { ...@@ -15,6 +15,7 @@ aspect CleanupAttributes {
eq RobotIsNotReadyToPick.time() = 4; eq RobotIsNotReadyToPick.time() = 4;
eq RobotIsNotReadyToDrop.time() = 4; eq RobotIsNotReadyToDrop.time() = 4;
eq WaitForEmptyTable.time() = 4; eq WaitForEmptyTable.time() = 4;
eq WaitForFullTable.time() = 4;
eq ASTNode.time() { eq ASTNode.time() {
throw new UnsupportedOperationException("Invalid use of attribute time():double"); throw new UnsupportedOperationException("Invalid use of attribute time():double");
} }
...@@ -23,6 +24,7 @@ aspect CleanupAttributes { ...@@ -23,6 +24,7 @@ aspect CleanupAttributes {
eq RobotIsNotReadyToPick.getWait().time() = time(); eq RobotIsNotReadyToPick.getWait().time() = time();
eq RobotIsNotReadyToDrop.getWait().time() = time(); eq RobotIsNotReadyToDrop.getWait().time() = time();
eq WaitForEmptyTable.getWait().time() = time(); eq WaitForEmptyTable.getWait().time() = time();
eq WaitForFullTable.getWait().time() = time();
syn String ASTNode.place(); // TODO can this be avoided? syn String ASTNode.place(); // TODO can this be avoided?
eq DropObjectAtRightPlace.place() = getRightPlace().getPlace(); eq DropObjectAtRightPlace.place() = getRightPlace().getPlace();
......
aspect RobotWorld { aspect RobotWorld {
public boolean RobotScene.simulated = true; public boolean RobotScene.simulated = true;
public String RobotScene.commandTopic = "/ceti_cell_empty/command";
public org.fusesource.mqtt.client.BlockingConnection RobotScene.connection; public org.fusesource.mqtt.client.BlockingConnection RobotScene.connection;
public static RobotScene RobotScene.initialWorld(java.util.Random random) { public static RobotScene RobotScene.initialWorld(java.util.Random random) {
......
...@@ -22,7 +22,7 @@ aspect SemanticActions { ...@@ -22,7 +22,7 @@ aspect SemanticActions {
} else { } else {
de.tudresden.inf.st.ceti.Command c = de.tudresden.inf.st.ceti.Command.newBuilder().setPick(de.tudresden.inf.st.ceti.Pick.newBuilder().setIdRobot("arm").setIdPick(object()).build()).build(); de.tudresden.inf.st.ceti.Command c = de.tudresden.inf.st.ceti.Command.newBuilder().setPick(de.tudresden.inf.st.ceti.Pick.newBuilder().setIdRobot("arm").setIdPick(object()).build()).build();
try { try {
scene.connection.publish("/ceti_cell_placeworld/command", c.toByteArray(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false); scene.connection.publish(scene.commandTopic, c.toByteArray(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -52,7 +52,7 @@ aspect SemanticActions { ...@@ -52,7 +52,7 @@ aspect SemanticActions {
} else { } else {
de.tudresden.inf.st.ceti.Command c = de.tudresden.inf.st.ceti.Command.newBuilder().setDrop(de.tudresden.inf.st.ceti.Drop.newBuilder().setIdRobot("arm").setIdBin(place()).build()).build(); de.tudresden.inf.st.ceti.Command c = de.tudresden.inf.st.ceti.Command.newBuilder().setDrop(de.tudresden.inf.st.ceti.Drop.newBuilder().setIdRobot("arm").setIdBin(place()).build()).build();
try { try {
scene.connection.publish("/ceti_cell_placeworld/command", c.toByteArray(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false); scene.connection.publish(scene.commandTopic, c.toByteArray(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -64,7 +64,7 @@ public class ParserTest { ...@@ -64,7 +64,7 @@ public class ParserTest {
RobotParser parser = new RobotParser(world); RobotParser parser = new RobotParser(world);
parser.setDebugDiagramDir(TIDY_AST_DIAGRAM_DIR); parser.setDebugDiagramDir(TIDY_AST_DIAGRAM_DIR);
// parse (synchonously, long-running) // parse (synchronously, long-running)
var result = parser.parse(); var result = parser.parse();
assertThat(result).isNotNull().isInstanceOf(Tidy.class); assertThat(result).isNotNull().isInstanceOf(Tidy.class);
...@@ -115,7 +115,7 @@ public class ParserTest { ...@@ -115,7 +115,7 @@ public class ParserTest {
// create a parser using the world // create a parser using the world
RobotParser parser = new RobotParser(world); RobotParser parser = new RobotParser(world);
// parse (synchonously, long-running) // parse (synchronously, long-running)
var result = parser.parse(); var result = parser.parse();
assertThat(result).isNotNull().isInstanceOf(Tidy.class); assertThat(result).isNotNull().isInstanceOf(Tidy.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment