diff --git a/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java index f60b56a9..b2954da8 100644 --- a/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java @@ -46,7 +46,6 @@ public ShooterSubsystem(ShooterIO io) { Units.rotationsPerMinuteToRadiansPerSecond(ShooterConstants.maxVelocityInRPMs), Units.rotationsPerMinuteToRadiansPerSecond( ShooterConstants.maxAccelerationInRPMsSquared)))); - setGoal(0); this.io = io; useSoftwarePidVelocityControl = !io.supportsHardwarePid(); @@ -103,25 +102,21 @@ public double getMeasurement() { @Override // Sets the voltage to volts. the volts value is -12 to 12 public void runVoltage(double volts) { - if (targetVoltage != volts) { - targetVoltage = volts; - targetVelocityRadPerSec = 0; - this.targetVelocityRPM = ShooterConstants.maxVelocityInRPMs * (volts / 12.0); - disable(); // disable PID control - io.setVoltage(targetVoltage); - } + targetVoltage = volts; + targetVelocityRadPerSec = 0; + this.targetVelocityRPM = ShooterConstants.maxVelocityInRPMs * (volts / 12.0); + disable(); // disable PID control + io.setVoltage(targetVoltage); } @Override public void runVelocity(double velocityRPM) { velocityRPM = MathUtil.clamp(velocityRPM, 0, ShooterConstants.maxVelocityInRPMs); - if (this.targetVelocityRPM != velocityRPM) { - targetVoltage = -1; - this.targetVelocityRPM = velocityRPM; - targetVelocityRadPerSec = Units.rotationsPerMinuteToRadiansPerSecond(velocityRPM); - setGoal(targetVelocityRadPerSec); - enable(); - } + targetVoltage = -1; + this.targetVelocityRPM = velocityRPM; + targetVelocityRadPerSec = Units.rotationsPerMinuteToRadiansPerSecond(velocityRPM); + setGoal(targetVelocityRadPerSec); + enable(); } @Override