X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunIndexWheelContinuous.java;h=95940130f11aac8c50ebc54dc29af5d2d13dcf76;hp=08ead3ac4bb6b52dfb8fd9cc974fd9d80d85724f;hb=cb8e86cb498c12dcf4e2b7a5916fc6f4926b77cf;hpb=7ba6bc91b8cf7205e05cdb974dc80fdd668ebe59 diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java index 08ead3a..9594013 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java @@ -34,23 +34,19 @@ public class RunIndexWheelContinuous extends Command { @Override protected void execute() { - double shooterSpeed = shooter.getShooterRPM(); - double targetShooterSpeed = shooter.getTargetShootingSpeed(); - double threshold = shooter.getRPMThreshold(); - // if (Math.abs(shooterSpeed - targetShooterSpeed) <= threshold) - if (timeSinceInitialized() % 0.5 <= 0.02) { - - if (Robot.getDriveTrain() - .getLeftGearPistonValue() == Constants.DriveTrain.LOW_GEAR) { - System.out.println("shifting to low gear " + timeSinceInitialized()); - Robot.getDriveTrain().setHighGear(); + if (Shooter.getShooter().getPistonValue() == Constants.Shooter.LOW_GEAR) { + Shooter.getShooter().setHighGear(); } else { - System.out.println("shifting to high gear " + timeSinceInitialized()); - Robot.getDriveTrain().setLowGear(); + Shooter.getShooter().setLowGear(); } } - shooter.runIndexWheel(); + + double shooterSpeed = shooter.getShooterRPM(); + double targetShooterSpeed = shooter.getTargetShootingSpeed(); + double threshold = shooter.getRPMThreshold(); + if (Math.abs(shooterSpeed - targetShooterSpeed) <= threshold) + shooter.runIndexWheel(); } @Override @@ -66,7 +62,6 @@ public class RunIndexWheelContinuous extends Command { @Override protected boolean isFinished() { return false; - } }