public void roboInit(){ autoSelector = new CommandSelector("Auto Mode"); autoSelector.addCommand(new CenterGearAuton(autoSelector.getColor())); autoSelector.addCommand(new BoilerGearAuton(autoSelector.getColor())); autoSelector.addCommand(new LoadingStationGearAuton(autoSelector.getColor())); autoSelector.addCommand(new HopperAuton(autoSelector.getColor())); autoSelector.addCommand(new CenterGearAutonShooting(autoSelector.getColor())); autoSelector.addCommand(new DriveStraightEncoderGyro(SmartDashboard.getNumber("TUNE PID Distance", 0.0), 0.7, 6)); autoSelector.addCommand(new StationaryGyroTurn(SmartDashboard.getNumber("TUNE PID Stat Angle", 0.0), 1)); } ... public void disabledPeriodic() { //allows us to reset the gyro and both encoders while disabled if(OI.driver.getButtonSt()){ drivetrain.reset(); } if(!(OI.operator.getButtonLB() && OI.operator.getButtonRB())) lookForAction = true; if(OI.operator.getButtonRB() && lookForAction){ autoSelector.incrementKey(); lookForAction = false; } if(OI.operator.getButtonLB() && lookForAction){ autoSelector.decrementKey(); lookForAction = false; } if(OI.operator.getButtonX()) autoSelector.setColorToBlue(); if(OI.operator.getButtonB()) autoSelector.setColorToRed(); } ... public void autonomousInit() { autonomousCommand = autoSelector.getSelected(); String teamColor = autoSelector.getColor(); if(autonomousCommand.getName().equals("CenterGear & Shoot")){ if(teamColor.equals("RED")) visionTable.setVisionOffset(-60.0); else visionTable.setVisionOffset(60.0); } System.out.println("***Starting "+autonomousCommand.getName()+" AutoMode***"); if (autonomousCommand != null) autonomousCommand.start(); }