/** Operator-controlled drive for Teleop mode. */ public void operatorControl() { boolean retry = true; while (retry) { try { retry = false; DriverStation.getInstance().setDigitalOut(2, false); DriverStation.getInstance().setDigitalOut(5, false); Robot.compressorPump.start(); teleopMode.init(); try { while (isOperatorControl() && isEnabled() && teleopMode.step()) { WorkerManager.work(); Dashboard.render(); } } catch (Exception ex) { logException(ex); retry = true; } teleopMode.disable(); Robot.compressorPump.stop(); } catch (Exception ex) { logException(ex); retry = true; } } }
/** Automated drive for autonomous mode. */ public void autonomous() { try { DriverStation.getInstance().setDigitalOut(2, false); DriverStation.getInstance().setDigitalOut(5, false); Robot.compressorPump.start(); hybridMode.init(); try { while (isAutonomous() && isEnabled() && hybridMode.step()) { WorkerManager.work(); Dashboard.render(); } } catch (Exception ex) { ex.printStackTrace(); } hybridMode.disable(); Robot.compressorPump.stop(); } catch (Exception ex) { logException(ex); } }