leftMotor.setAcceleration(Constants.acceleration);
rightMotor.stop(true);
leftMotor.stop(true);
+ measMotor.stop(true);
}
protected void measureLake(){
long time = System.currentTimeMillis();
rightMotor.backward();
leftMotor.backward();
- while(System.currentTimeMillis()-time<500){
+ while(System.currentTimeMillis()-time < 250){
Thread.yield();
}
rightMotor.setSpeed(25);
leftMotor.setSpeed(25);
if(sensors.leftLight() && !sensors.rightLight()){
- leftTurn(15);
+ leftTurn(10);
} else if (sensors.rightLight() && !sensors.leftLight()){
- rightTurn(15);
+ rightTurn(10);
}
rightMotor.stop(true);
leftMotor.stop(true);
- measMotor.backward();
- while(!suppressed && !measMotor.isStalled()){
+ measMotor.rotate(-100, true);
+ while(!suppressed && !measMotor.isStalled() && measMotor.isMoving()){
Thread.yield();
}
- measMotor.forward();
- while(!suppressed && !measMotor.isStalled()){
+ measMotor.rotate(100, true);
+ while(!suppressed && !measMotor.isStalled() && measMotor.isMoving()){
Thread.yield();
}
measMotor.stop(true);
- turnRandom(30, 45);
+ reset();
+ rightMotor.backward();
+ leftMotor.backward();
+ while(System.currentTimeMillis()-time < 250){
+ Thread.yield();
+ }
+ turnRandom(45, 60);
}
protected void measureRock(){
long time = System.currentTimeMillis();
rightMotor.forward();
leftMotor.forward();
- while(System.currentTimeMillis()-time<1500){
+ while(System.currentTimeMillis()-time<1000){
Thread.yield();
}
}
measMotor.stop(true);
+ rightMotor.backward();
+ leftMotor.backward();
+ while(System.currentTimeMillis()-time<1000){
+ Thread.yield();
+ }
turnRandom(30, 45);
}
}
rightMotor.stop(true);
leftMotor.stop(true);
- LCDPrinter.print(Float.toString(sensors.gyro()));
+ System.out.println(Float.toString(sensors.gyro()));
}
protected void leftTurn(int angle){
}
rightMotor.stop(true);
leftMotor.stop(true);
- LCDPrinter.print(Float.toString(sensors.gyro()));
+ System.out.println(Float.toString(sensors.gyro()));
}
@Override