/** Main method that gets the Trabant going. */ public void go() throws InterruptedException { try { dashboard.log("Running ..."); driveDirect(speed, speed); howFarBacked = howFarToGoBackWhenBumped; while (isRunning()) { try { stateController(); } catch (Exception ex) { Logger.getLogger(Trabant.class.getName()).log(Level.SEVERE, null, ex); } } dashboard.log("Run completed."); } catch (ConnectionLostException ex) { Logger.getLogger(Trabant.class.getName()).log(Level.SEVERE, null, ex); } }
/** * This method is called repeatedly * * @throws ConnectionLostException */ public void loop() throws ConnectionLostException { try { sonar.read(); } catch (InterruptedException ex) { } dashboard.log( "L: " + sonar.getLeftDistance() + " F: " + sonar.getFrontDistance() + " R: " + sonar.getRightDistance()); }
public void initialize() throws ConnectionLostException { dashboard.log("===========Start==========="); readSensors(SENSORS_GROUP_ID6); dashboard.log("Battery Charge = " + getBatteryCharge() + ", 3,000 = Full charge"); }