Fixed some bugs when recentering the camera.

This commit is contained in:
2014-04-04 10:32:29 -04:30
parent 1481ebe349
commit 50278109eb
2 changed files with 9 additions and 8 deletions

View File

@@ -122,8 +122,9 @@ public class NxtAR_bot{
* Force quit. * Force quit.
*/ */
@Override @Override
public void buttonPressed(Button b) { public void buttonPressed(Button b){
quit(); System.exit(0);
//quit();
} }
/** /**

View File

@@ -113,12 +113,12 @@ public class MotorControlThread extends Thread{
} }
if(recenterMotorB){ if(recenterMotorB){
// Return motor B to it's origin. Rotate in the direction System.out.println("RECENTER");
// that implies less movement. // Return motor B to it's origin.
Motor.B.setSpeed(50 * Battery.getVoltage());
tacho = Motor.B.getTachoCount() % 360; tacho = Motor.B.getTachoCount() % 360;
rotation = tacho > 180 ? 360 - tacho : -(tacho); rotation = -(tacho);
Motor.B.rotate(rotation); Motor.B.rotate(rotation, false);
Motor.B.resetTachoCount();
} }
}catch(IOException io){ }catch(IOException io){