From: Mart Lubbers Date: Wed, 16 Dec 2015 11:26:11 +0000 (+0100) Subject: this will fix the behaviour' X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=9e9aab249373630a777c0407f08e605b50a24d2e;p=des2015.git this will fix the behaviour' --- diff --git a/dsl/runtime/src/nl/ru/des/BasicBehaviour.java b/dsl/runtime/src/nl/ru/des/BasicBehaviour.java index fb70588..e55558d 100644 --- a/dsl/runtime/src/nl/ru/des/BasicBehaviour.java +++ b/dsl/runtime/src/nl/ru/des/BasicBehaviour.java @@ -33,11 +33,11 @@ public abstract class BasicBehaviour implements Behavior{ protected void measure(){ measMotor.backward(); - while(!measMotor.isStalled()){ + while(suppressed == SuppressedState.IN_ACTION && !measMotor.isStalled()){ Thread.yield(); } measMotor.forward(); - while(!measMotor.isStalled()){ + while(suppressed == SuppressedState.IN_ACTION && !measMotor.isStalled()){ Thread.yield(); } measMotor.stop(true); @@ -50,7 +50,7 @@ public abstract class BasicBehaviour implements Behavior{ sensors.resetGyro(); rightMotor.backward(); leftMotor.forward(); - while(suppressed != SuppressedState.SUPPRESSED && Math.abs(sensors.gyro()) < angle){ + while(suppressed == SuppressedState.IN_ACTION && Math.abs(sensors.gyro()) < angle){ Thread.yield(); } LCDPrinter.print(Float.toString(sensors.gyro())); @@ -62,7 +62,7 @@ public abstract class BasicBehaviour implements Behavior{ sensors.resetGyro(); leftMotor.backward(); rightMotor.forward(); - while(suppressed != SuppressedState.SUPPRESSED && Math.abs(sensors.gyro()) < angle){ + while(suppressed == SuppressedState.IN_ACTION && Math.abs(sensors.gyro()) < angle){ Thread.yield(); } LCDPrinter.print(Float.toString(sensors.gyro()));