X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunFlyWheelContinuous.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunFlyWheelContinuous.java;h=86c31f7eecd523ebc2a274a6b4d1d58bb74d45ed;hp=fa5426e90a21580e42d14c76e7f2d98ef9ac72ed;hb=7ba6bc91b8cf7205e05cdb974dc80fdd668ebe59;hpb=f625e57a09b295f7d40e4568a8e3a8cd125630aa diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java index fa5426e..86c31f7 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java @@ -22,35 +22,18 @@ public class RunFlyWheelContinuous extends Command { private Shooter shooter = Robot.getShooter(); private PIDController wheelController; - private double wheelP; - private double wheelI; - private double wheelD; - private double target; - private double shooterSpeed = 0; public RunFlyWheelContinuous() { - this.wheelP = this.shooter.wheelP; - this.wheelI = this.shooter.wheelI; - this.wheelD = this.shooter.wheelD; - this.wheelController = new PIDController(this.wheelP, this.wheelI, - this.wheelD); - this.wheelController.setDoneRange(10); - this.wheelController.setMaxOutput(1.0); - this.wheelController.setMinDoneCycles(3); - this.target = shooter.getCurrentShootingSpeed(); } @Override protected void initialize() { - this.wheelController.setSetPoint(this.target); + shooter.initializePIDController(); } @Override protected void execute() { - double calculatedShooterIncrement = this.wheelController - .calcPID(this.shooter.getShooterRPM()); - shooterSpeed += calculatedShooterIncrement; - this.shooter.setFlyWheelMotorVal(shooterSpeed); + shooter.setFlyWheelMotorVal(shooter.calculateShooterSpeed()); } @Override