diff --git a/src/main/java/frc/robot/commands/ShooterCalc.java b/src/main/java/frc/robot/commands/ShooterCalc.java index 9b71bc42..2c5223e3 100644 --- a/src/main/java/frc/robot/commands/ShooterCalc.java +++ b/src/main/java/frc/robot/commands/ShooterCalc.java @@ -107,16 +107,16 @@ public Command sendBackCommand() { public Command resetShooter() { return Commands.runOnce(() -> stopAiming()) - .andThen(Commands.runOnce(() -> shooterStop())) - .alongWith(Commands.runOnce(() -> pivotSetRestAngle())); + .andThen(shooterStopCommand() + .alongWith(Commands.runOnce(() -> pivotSetRestAngle()))); } public void shooterSetSpeed(double speed) { shooter.setSpeed(speed); } - public void shooterStop() { - shooter.stop(); + public Command shooterStopCommand() { + return shooter.stop(); } public void pivotSetAngle(double angle) { diff --git a/src/main/java/frc/robot/subsystems/shooter/Pivot.java b/src/main/java/frc/robot/subsystems/shooter/Pivot.java index ac1fe1ba..2455f77f 100644 --- a/src/main/java/frc/robot/subsystems/shooter/Pivot.java +++ b/src/main/java/frc/robot/subsystems/shooter/Pivot.java @@ -36,8 +36,6 @@ public void configMotor() { } public void setAngle(double angle) { - // Divide by 180 because angle will be a value between 180 and -180 - // and we want to set the position between 1.0 and -1.0 pivot.setTargetPosition(angle / ShooterConstants.PIVOT_MAX_ANGLE); } public void setRestAngle() { diff --git a/src/main/java/frc/robot/subsystems/shooter/Shooter.java b/src/main/java/frc/robot/subsystems/shooter/Shooter.java index 370c82c6..45a31e82 100644 --- a/src/main/java/frc/robot/subsystems/shooter/Shooter.java +++ b/src/main/java/frc/robot/subsystems/shooter/Shooter.java @@ -48,7 +48,7 @@ public void setSpeed(double speed) { } public Command stop() { - return Commands.run(() -> motorLeft.setTargetVelocity(0)); + return Commands.runOnce(() -> motorLeft.setTargetVelocity(0)); } //TODO: Implement a way to get the RPM of the shooter