File tree Expand file tree Collapse file tree
src/main/java/frc/robot/subsystems/shooter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package frc .robot .subsystems .shooter ;
22
3+ import edu .wpi .first .math .MathUtil ;
34import edu .wpi .first .wpilibj2 .command .Command ;
4- import edu .wpi .first .wpilibj2 .command .RunCommand ;
55import edu .wpi .first .wpilibj2 .command .SubsystemBase ;
66import java .util .function .DoubleSupplier ;
77import org .littletonrobotics .junction .Logger ;
@@ -25,11 +25,12 @@ public double getVoltage() {
2525 }
2626
2727 public Command runVoltage (DoubleSupplier voltage ) {
28- return new RunCommand (() -> io .setVoltage (voltage .getAsDouble ()), this );
28+ return run (() -> io .setVoltage (MathUtil .clamp (voltage .getAsDouble (), -12 , 12 )))
29+ .withName ("Cool Voltage Command" );
2930 }
3031
3132 public Command runRPM (DoubleSupplier rpm ) {
32- return new RunCommand (() -> io .setRPM (rpm .getAsDouble ()), this );
33+ return run (() -> io .setRPM (rpm .getAsDouble ())). withName ( "Cool RPM Command" );
3334 }
3435
3536 public void setPIDGains (double Kp , double Ki , double Kd ) {
You can’t perform that action at this time.
0 commit comments