+ /**
+ * Stops index wheel motor.
+ */
+ public void stopIndexWheel() {
+ indexWheel.set(0);
+ }
+
+ @Override
+ protected void initDefaultCommand() {
+
+ }
+
+ public double getRPMThreshold() {
+ return RPM_THRESHOLD;
+ }
+
+ public double getShooterRPM() {
+ return hallEffect.getRPM();
+ }
+
+ public void setTargetShootingSpeed(double Value) {
+ targetShootingSpeed = Value;
+ }
+
+ public void decrementTargetShootingSpeed() {
+ this.targetShootingSpeed -= this.SHOOTING_SPEED_INCREMENT;
+ }
+
+ public void incrementTargetShootingSpeed() {
+ this.targetShootingSpeed += this.SHOOTING_SPEED_INCREMENT;
+ }
+
+ public void resetTargetShootingSpeed() {
+ this.targetShootingSpeed = this.DEFAULT_SHOOTING_SPEED;
+ }
+
+ public double getTargetShootingSpeed() {
+ return targetShootingSpeed;
+ }
+
+ public void reverseIndexWheel() {
+ this.setIndexWheelMotorVal(-DEFAULT_INDEXING_MOTOR_VALUE);
+ }
+
+ public void runIndexWheel() {
+ this.setIndexWheelMotorVal(DEFAULT_INDEXING_MOTOR_VALUE);
+ }
+
+ public double calculateShooterSpeed() {
+ this.wheelController.setSetPoint(targetShootingSpeed);
+ double calculatedShooterIncrement = this.wheelController
+ .calcPID(this.getShooterRPM());
+ currentShooterMotorValue += calculatedShooterIncrement;
+ return currentShooterMotorValue;
+ }
+
+ public void initializePIDController() {
+ this.wheelController = new PIDController(wheelP, wheelI, wheelD);
+ this.wheelController.setDoneRange(10);
+ this.wheelController.setMaxOutput(1.0);
+ this.wheelController.setMinDoneCycles(3);
+ this.wheelController.setSetPoint(this.targetShootingSpeed);
+ this.currentShooterMotorValue = 0;
+ }