From 9e9aab249373630a777c0407f08e605b50a24d2e Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 16 Dec 2015 12:26:11 +0100 Subject: [PATCH] this will fix the behaviour' --- dsl/runtime/src/nl/ru/des/BasicBehaviour.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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())); -- 2.20.1