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

simplify

parent 2334480c
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,7 @@ aspect SemanticActions { ...@@ -4,9 +4,7 @@ aspect SemanticActions {
RobotScene scene = world.asRobotScene(); RobotScene scene = world.asRobotScene();
System.out.println("performing semantic action for element Pick"); System.out.println("performing semantic action for element Pick");
String objectName = object(); String objectName = object();
java.util.concurrent.Executors.newSingleThreadExecutor().submit(new Runnable() { java.util.concurrent.Executors.newSingleThreadExecutor().submit(() -> {
@Override
public void run() {
scene.getRobot().setIsIdle(false); scene.getRobot().setIsIdle(false);
try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ } try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ }
MovableObject object = scene.getTable().getMovableObjectByName(objectName); MovableObject object = scene.getTable().getMovableObjectByName(objectName);
...@@ -14,7 +12,6 @@ aspect SemanticActions { ...@@ -14,7 +12,6 @@ aspect SemanticActions {
object.setPose(Pose.of(-1,-1,-1)); object.setPose(Pose.of(-1,-1,-1));
try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ } try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ }
scene.getRobot().setIsIdle(true); scene.getRobot().setIsIdle(true);
}
}); });
} }
...@@ -23,9 +20,7 @@ aspect SemanticActions { ...@@ -23,9 +20,7 @@ aspect SemanticActions {
System.out.println("performing semantic action for element Pick"); System.out.println("performing semantic action for element Pick");
String objectName = object(); String objectName = object();
String placeName = place(); String placeName = place();
java.util.concurrent.Executors.newSingleThreadExecutor().submit(new Runnable() { java.util.concurrent.Executors.newSingleThreadExecutor().submit(() -> {
@Override
public void run() {
scene.getRobot().setIsIdle(false); scene.getRobot().setIsIdle(false);
try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ } try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ }
MovableObject object = scene.getTable().getMovableObjectByName(objectName); MovableObject object = scene.getTable().getMovableObjectByName(objectName);
...@@ -34,7 +29,6 @@ aspect SemanticActions { ...@@ -34,7 +29,6 @@ aspect SemanticActions {
scene.getRobot().setAttachedItem(null); scene.getRobot().setAttachedItem(null);
try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ } try { Thread.sleep(1200); } catch (InterruptedException e) { /* ignore */ }
scene.getRobot().setIsIdle(true); scene.getRobot().setIsIdle(true);
}
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment