]> git.taranathan.com Git - FRC2026.git/commitdiff
make work gud
authormoo <moogoesmeow123@gmail.com>
Sun, 29 Mar 2026 22:41:35 +0000 (15:41 -0700)
committeriefomit <timofei.stem@gmail.com>
Sun, 29 Mar 2026 23:10:58 +0000 (16:10 -0700)
src/main/java/frc/robot/subsystems/spindexer/Spindexer.java

index 50aa904c89173c63f054a2065de87b556200b19b..df6bb830914179c049b781b5fd45bd852253f882 100644 (file)
@@ -53,7 +53,7 @@ public class Spindexer extends SubsystemBase implements SpindexerIO {
         Logger.processInputs("Spindexer", inputs);
 
         if (resetPos == null) {
-            resetPos = (motor.getPosition().getValueAsDouble() % gearRatio);
+            resetPos = (motor.getPosition().getValueAsDouble() % gearRatio) % 1.0;
             resetPID.reset();
         }
 
@@ -67,7 +67,7 @@ public class Spindexer extends SubsystemBase implements SpindexerIO {
             motor.set(0.0);
             reversing = false;
         } else if (state == SpindexerState.RESET && resetPos != null) {
-            motor.set(resetPID.calculate((motor.getPosition().getValueAsDouble() % gearRatio), resetPos));
+            motor.set(resetPID.calculate((motor.getPosition().getValueAsDouble() % gearRatio) % 1.0, resetPos));
         } else {
             motor.set(power);
             reversing = false;