]> git.taranathan.com Git - FRC2026.git/commitdiff
spelling fixes etc
authoriefomit <timofei.stem@gmail.com>
Mon, 6 Apr 2026 04:35:17 +0000 (21:35 -0700)
committeriefomit <timofei.stem@gmail.com>
Mon, 6 Apr 2026 04:35:17 +0000 (21:35 -0700)
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/commands/gpm/RunSpindexer.java
src/main/java/frc/robot/subsystems/LED/LED.java [new file with mode: 0644]
src/main/java/frc/robot/subsystems/LED/LED2.java [deleted file]
src/main/java/frc/robot/subsystems/drivetrain/Drivetrain.java
src/main/java/frc/robot/subsystems/drivetrain/Module.java
src/main/java/frc/robot/util/BrownOut/BrownOutConstants.java

index 5dcbaee848d854cf5e5171656f7bbe05feba1250..51f3dc56b7319b375c8474b3da3c59e7e9e72a45 100644 (file)
@@ -37,7 +37,7 @@ import frc.robot.controls.Operator;
 import frc.robot.controls.PS5ControllerDriverConfig;
 import frc.robot.subsystems.Climb.LinearClimb;
 import frc.robot.subsystems.Intake.Intake;
-import frc.robot.subsystems.LED.LED2;
+import frc.robot.subsystems.LED.LED;
 import frc.robot.subsystems.drivetrain.Drivetrain;
 import frc.robot.subsystems.drivetrain.GyroIOPigeon2;
 import frc.robot.subsystems.hood.Hood;
@@ -74,7 +74,7 @@ public class RobotContainer {
   private BaseDriverConfig driver = null;
   private Operator operator = null;
   private LinearClimb linearClimb = null;
-  private LED2 led = null;
+  private LED led = null;
 
   // TODO: move to correct robot and put the correct port?
   private PS5Controller ps5 = new PS5Controller(0);
@@ -124,9 +124,7 @@ public class RobotContainer {
       case PrimeJr: // AKA Valence
         spindexer = new Spindexer();
         intake = new Intake();
-        // led = new LED();
-        // led.setDefaultCommand(new LEDDefaultCommand(led));
-        led = new LED2();
+        led = new LED();
 
       case WaffleHouse: // AKA Betabot
         turret = new Turret();
@@ -142,7 +140,6 @@ public class RobotContainer {
         // fall-through
 
       case Vivace:
-        // linearClimb = new LinearClimb();
 
       case Phil: // AKA "IHOP"
 
index adc423f9f4edcfd7b75ce5034e382a2c065d3487..d730b6938632a7b90473bce7d124432c996f0f91 100644 (file)
@@ -5,7 +5,6 @@ import edu.wpi.first.math.filter.Debouncer.DebounceType;
 import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 import edu.wpi.first.wpilibj2.command.Command;
-import edu.wpi.first.wpilibj2.command.ScheduleCommand;
 import frc.robot.constants.Constants;
 import frc.robot.constants.IntakeConstants;
 import frc.robot.subsystems.Intake.Intake;
diff --git a/src/main/java/frc/robot/subsystems/LED/LED.java b/src/main/java/frc/robot/subsystems/LED/LED.java
new file mode 100644 (file)
index 0000000..b1e1062
--- /dev/null
@@ -0,0 +1,181 @@
+package frc.robot.subsystems.LED;
+
+import java.util.Optional;
+
+import com.ctre.phoenix6.configs.CANdleConfigurator;
+import com.ctre.phoenix6.configs.CANdleFeaturesConfigs;
+import com.ctre.phoenix6.configs.LEDConfigs;
+import com.ctre.phoenix6.controls.ColorFlowAnimation;
+import com.ctre.phoenix6.controls.FireAnimation;
+import com.ctre.phoenix6.controls.RainbowAnimation;
+import com.ctre.phoenix6.controls.RgbFadeAnimation;
+import com.ctre.phoenix6.controls.SolidColor;
+import com.ctre.phoenix6.controls.StrobeAnimation;
+import com.ctre.phoenix6.controls.TwinkleAnimation;
+import com.ctre.phoenix6.hardware.CANdle;
+import com.ctre.phoenix6.signals.Enable5VRailValue;
+import com.ctre.phoenix6.signals.LossOfSignalBehaviorValue;
+import com.ctre.phoenix6.signals.RGBWColor;
+import com.ctre.phoenix6.signals.StatusLedWhenActiveValue;
+import com.ctre.phoenix6.signals.StripTypeValue;
+import com.ctre.phoenix6.signals.VBatOutputModeValue;
+
+import edu.wpi.first.wpilibj.DriverStation;
+import edu.wpi.first.wpilibj.DriverStation.Alliance;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+import edu.wpi.first.wpilibj.util.Color;
+import edu.wpi.first.wpilibj2.command.InstantCommand;
+import edu.wpi.first.wpilibj2.command.SubsystemBase;
+import frc.robot.constants.Constants;
+import frc.robot.constants.IdConstants;
+import frc.robot.util.HubActive;
+
+public class LED extends SubsystemBase {
+
+       private CANdle candle;
+       public static final int stripLength = 67;
+
+       /// Hz
+       public static final int FLASH_RATE = 4;
+
+       private Color color;
+       
+       public LED() {
+               candle = new CANdle(IdConstants.CANDLE_ID, Constants.RIO_CAN);
+               CANdleConfigurator configurator = candle.getConfigurator();
+
+               LEDConfigs ledConf = new LEDConfigs()
+                               .withStripType(StripTypeValue.GRB)
+                               .withLossOfSignalBehavior(LossOfSignalBehaviorValue.KeepRunning)
+                               .withBrightnessScalar(1);
+
+               CANdleFeaturesConfigs featureConf = new CANdleFeaturesConfigs()
+                               .withEnable5VRail(Enable5VRailValue.Enabled) // Turns off LEDs
+                               .withStatusLedWhenActive(StatusLedWhenActiveValue.Disabled)
+                               .withVBatOutputMode(VBatOutputModeValue.On);
+
+               configurator.apply(featureConf);
+               configurator.apply(ledConf);
+
+               setColor();
+
+               candle.clearAllAnimations();
+               lightsOff();
+
+               System.out.println("CANdle features: " + featureConf + ", LED config: " + ledConf);
+
+               SmartDashboard.putData("LED Disable", new InstantCommand(() -> {forceOff = true; lightsOff();}).ignoringDisable(true));
+               SmartDashboard.putData("LED Enable", new InstantCommand(() -> forceOff = false).ignoringDisable(true));
+               SmartDashboard.putData("LED Strobe", new InstantCommand(() -> setStrobe()).ignoringDisable(true));
+               SmartDashboard.putData("LED Static", new InstantCommand(() -> setStatic()).ignoringDisable(true));
+               SmartDashboard.putData("LED Fire", new InstantCommand(() -> setFire()).ignoringDisable(true));
+               SmartDashboard.putData("LED Rainbow", new InstantCommand(() -> setRainbow()).ignoringDisable(true));
+               SmartDashboard.putData("LED Fade", new InstantCommand(() -> setRgbFadeAnimation()).ignoringDisable(true));
+               SmartDashboard.putData("LED Twinkle", new InstantCommand(() -> setTwinkle()).ignoringDisable(true));
+               SmartDashboard.putData("LED Color Flow", new InstantCommand(() -> setColorFlow()).ignoringDisable(true));
+               SmartDashboard.putData("LED Color Team Reset", new InstantCommand(() -> setColor()).ignoringDisable(true));
+       }
+
+       public void setColor() {
+               var alliance = DriverStation.getAlliance();
+               if (alliance.isEmpty()) {
+                       color = Color.kOrangeRed;
+               } else if (alliance.get() == Alliance.Red) {
+                       color = Color.kRed;
+               } else if (alliance.get() == Alliance.Blue) {
+                       color = Color.kBlue;
+               } else {
+                       color = Color.kOrangeRed;
+               }
+       }
+
+       private enum State { OFF, ON, AUTO, SLOW, FAST, ENDGAME };
+
+       private State lastState = State.OFF;
+       private boolean forceOff = false;
+
+       @Override
+       public void periodic() {
+               State targetState = State.ON;
+               if (underSecsToFlip(5)) targetState = State.SLOW;
+               if (underSecsToFlip(1)) targetState = State.FAST;
+               if (DriverStation.isAutonomous()) targetState = State.AUTO;
+               if (DriverStation.getMatchTime() < 30) targetState = State.ENDGAME;
+               if (forceOff) targetState = State.OFF;
+
+               if (targetState != lastState) {
+                       switch (targetState) {
+                               case OFF: lightsOff(); break;
+                               case ON: setStatic(); break;
+                               case AUTO: setTwinkle(); break;
+                               case SLOW: setStrobe(); break;
+                               case FAST: setFastStrobe(); break;
+                               case ENDGAME: setRainbow(); break;
+                       }
+                       lastState = targetState;
+               }
+       }
+
+       public void setFire() {
+               candle.clearAllAnimations();
+               candle.setControl(new FireAnimation(8, 8 + stripLength).withSparking(0.5));
+       }
+
+       public void setRainbow() {
+               candle.clearAllAnimations();
+               candle.setControl(new RainbowAnimation(8, 8 + stripLength));
+       }
+
+       public void setRgbFadeAnimation() {
+               candle.clearAllAnimations();
+               candle.setControl(new RgbFadeAnimation(8, 8 + stripLength));
+       }
+
+       public void setTwinkle() {
+               candle.clearAllAnimations();
+               candle.setControl(new TwinkleAnimation(8, 8 + stripLength).withColor(new RGBWColor(Color.kViolet)));
+       }
+
+       public void setColorFlow() {
+               candle.clearAllAnimations();
+               candle.setControl(new ColorFlowAnimation(8, 8 + stripLength).withColor(new RGBWColor(Color.kAzure)));
+       }
+
+       public void setStrobe() {
+               candle.clearAllAnimations();
+               candle.setControl(new StrobeAnimation(8, 8 + stripLength).withFrameRate(FLASH_RATE).withColor(new RGBWColor(color)));
+       }
+
+       public void setFastStrobe() {
+               candle.clearAllAnimations();
+               candle.setControl(new StrobeAnimation(8, 8 + stripLength).withFrameRate(FLASH_RATE * 4).withColor(new RGBWColor(color)));
+       }
+
+       public void setStatic() {
+               candle.clearAllAnimations();
+               candle.setControl(new SolidColor(8, 8 + stripLength).withColor(new RGBWColor(color)));
+       }
+
+       public void lightsOff() {
+               candle.clearAllAnimations();
+               candle.setControl(new SolidColor(8 , 8 + stripLength).withColor(new RGBWColor(0, 0, 0, 0)));
+       }
+       
+
+       private boolean underSecsToFlip(double secs) {
+               Optional<Double> timeToActive = HubActive.timeToActive();
+               Optional<Double> timeToInactive = HubActive.timeToInactive();
+
+               if (timeToActive.isEmpty() && timeToInactive.isEmpty()) {
+                       return false;
+               } else if (timeToActive.isPresent() && timeToActive.get() != 0) {
+                       return (timeToActive.get() <= secs);
+
+               } else if (timeToInactive.isPresent() && timeToInactive.get() != 0) {
+                       return (timeToInactive.get() <= secs);
+               } else {
+                       return false;
+               }
+       }
+
+}
diff --git a/src/main/java/frc/robot/subsystems/LED/LED2.java b/src/main/java/frc/robot/subsystems/LED/LED2.java
deleted file mode 100644 (file)
index 1d7f91f..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-package frc.robot.subsystems.LED;
-
-import java.util.Optional;
-
-import com.ctre.phoenix6.configs.CANdleConfigurator;
-import com.ctre.phoenix6.configs.CANdleFeaturesConfigs;
-import com.ctre.phoenix6.configs.LEDConfigs;
-import com.ctre.phoenix6.controls.ColorFlowAnimation;
-import com.ctre.phoenix6.controls.FireAnimation;
-import com.ctre.phoenix6.controls.RainbowAnimation;
-import com.ctre.phoenix6.controls.RgbFadeAnimation;
-import com.ctre.phoenix6.controls.SolidColor;
-import com.ctre.phoenix6.controls.StrobeAnimation;
-import com.ctre.phoenix6.controls.TorqueCurrentFOC;
-import com.ctre.phoenix6.controls.TwinkleAnimation;
-import com.ctre.phoenix6.hardware.CANdle;
-import com.ctre.phoenix6.signals.Enable5VRailValue;
-import com.ctre.phoenix6.signals.LossOfSignalBehaviorValue;
-import com.ctre.phoenix6.signals.RGBWColor;
-import com.ctre.phoenix6.signals.StatusLedWhenActiveValue;
-import com.ctre.phoenix6.signals.StripTypeValue;
-import com.ctre.phoenix6.signals.VBatOutputModeValue;
-
-import edu.wpi.first.wpilibj.DriverStation;
-import edu.wpi.first.wpilibj.DriverStation.Alliance;
-import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
-import edu.wpi.first.wpilibj.util.Color;
-import edu.wpi.first.wpilibj2.command.InstantCommand;
-import edu.wpi.first.wpilibj2.command.SubsystemBase;
-import frc.robot.constants.Constants;
-import frc.robot.constants.IdConstants;
-import frc.robot.util.HubActive;
-
-public class LED2 extends SubsystemBase {
-
-       private CANdle candle;
-       public static final int stripLength = 67;
-
-       /// Hz
-       public static final int FLASH_RATE = 4;
-
-       private Color color;
-       
-       public LED2() {
-               candle = new CANdle(IdConstants.CANDLE_ID, Constants.RIO_CAN);
-               CANdleConfigurator configurator = candle.getConfigurator();
-
-               LEDConfigs ledConf = new LEDConfigs()
-                               .withStripType(StripTypeValue.GRB)
-                               .withLossOfSignalBehavior(LossOfSignalBehaviorValue.KeepRunning)
-                               .withBrightnessScalar(1);
-
-               CANdleFeaturesConfigs featureConf = new CANdleFeaturesConfigs()
-                               .withEnable5VRail(Enable5VRailValue.Enabled) // Turns off LEDs
-                               .withStatusLedWhenActive(StatusLedWhenActiveValue.Disabled)
-                               .withVBatOutputMode(VBatOutputModeValue.On);
-
-               configurator.apply(featureConf);
-               configurator.apply(ledConf);
-
-               setColor();
-
-               candle.clearAllAnimations();
-               lightsOff();
-
-               System.out.println("CANdle features: " + featureConf + ", LED config: " + ledConf);
-
-               SmartDashboard.putData("LED Disable", new InstantCommand(() -> {forceOff = true; lightsOff();}).ignoringDisable(true));
-               SmartDashboard.putData("LED Enable", new InstantCommand(() -> forceOff = false).ignoringDisable(true));
-               SmartDashboard.putData("LED Strobe", new InstantCommand(() -> setStrobe()).ignoringDisable(true));
-               SmartDashboard.putData("LED Static", new InstantCommand(() -> setStatic()).ignoringDisable(true));
-               SmartDashboard.putData("LED Fire", new InstantCommand(() -> setFire()).ignoringDisable(true));
-               SmartDashboard.putData("LED Rainbow", new InstantCommand(() -> setRainbow()).ignoringDisable(true));
-               SmartDashboard.putData("LED Fade", new InstantCommand(() -> setRgbFadeAnimation()).ignoringDisable(true));
-               SmartDashboard.putData("LED Twinkle", new InstantCommand(() -> setTwinkle()).ignoringDisable(true));
-               SmartDashboard.putData("LED Color Flow", new InstantCommand(() -> setColorFlow()).ignoringDisable(true));
-               SmartDashboard.putData("LED Color Team Reset", new InstantCommand(() -> setColor()).ignoringDisable(true));
-       }
-
-       public void setColor() {
-               var alliance = DriverStation.getAlliance();
-               if (alliance.isEmpty()) {
-                       color = Color.kOrangeRed;
-               } else if (alliance.get() == Alliance.Red) {
-                       color = Color.kRed;
-               } else if (alliance.get() == Alliance.Blue) {
-                       color = Color.kBlue;
-               } else {
-                       color = Color.kOrangeRed;
-               }
-       }
-
-       private enum State { OFF, ON, AUTO, SLOW, FAST, ENDGAME };
-
-       private State lastState = State.OFF;
-       private boolean forceOff = false;
-
-       @Override
-       public void periodic() {
-               State targetState = State.ON;
-               if (underSecsToFlip(5)) targetState = State.SLOW;
-               if (underSecsToFlip(1)) targetState = State.FAST;
-               if (DriverStation.isAutonomous()) targetState = State.AUTO;
-               if (DriverStation.getMatchTime() < 30) targetState = State.ENDGAME;
-               if (forceOff) targetState = State.OFF;
-
-               if (targetState != lastState) {
-                       switch (targetState) {
-                               case OFF: lightsOff(); break;
-                               case ON: setStatic(); break;
-                               case AUTO: setTwinkle(); break;
-                               case SLOW: setStrobe(); break;
-                               case FAST: setFastStrobe(); break;
-                               case ENDGAME: setRainbow(); break;
-                       }
-                       lastState = targetState;
-               }
-       }
-
-       public void setFire() {
-               candle.clearAllAnimations();
-               candle.setControl(new FireAnimation(8, 8 + stripLength).withSparking(0.5));
-       }
-
-       public void setRainbow() {
-               candle.clearAllAnimations();
-               candle.setControl(new RainbowAnimation(8, 8 + stripLength));
-       }
-
-       public void setRgbFadeAnimation() {
-               candle.clearAllAnimations();
-               candle.setControl(new RgbFadeAnimation(8, 8 + stripLength));
-       }
-
-       public void setTwinkle() {
-               candle.clearAllAnimations();
-               candle.setControl(new TwinkleAnimation(8, 8 + stripLength).withColor(new RGBWColor(Color.kViolet)));
-       }
-
-       public void setColorFlow() {
-               candle.clearAllAnimations();
-               candle.setControl(new ColorFlowAnimation(8, 8 + stripLength).withColor(new RGBWColor(Color.kAzure)));
-       }
-
-       public void setStrobe() {
-               candle.clearAllAnimations();
-               candle.setControl(new StrobeAnimation(8, 8 + stripLength).withFrameRate(FLASH_RATE).withColor(new RGBWColor(color)));
-       }
-
-       public void setFastStrobe() {
-               candle.clearAllAnimations();
-               candle.setControl(new StrobeAnimation(8, 8 + stripLength).withFrameRate(FLASH_RATE * 4).withColor(new RGBWColor(color)));
-       }
-
-       public void setStatic() {
-               candle.clearAllAnimations();
-               candle.setControl(new SolidColor(8, 8 + stripLength).withColor(new RGBWColor(color)));
-       }
-
-       public void lightsOff() {
-               candle.clearAllAnimations();
-               candle.setControl(new SolidColor(8 , 8 + stripLength).withColor(new RGBWColor(0, 0, 0, 0)));
-       }
-       
-
-       private boolean underSecsToFlip(double secs) {
-               Optional<Double> timeToActive = HubActive.timeToActive();
-               Optional<Double> timeToInactive = HubActive.timeToInactive();
-
-               if (timeToActive.isEmpty() && timeToInactive.isEmpty()) {
-                       return false;
-               } else if (timeToActive.isPresent() && timeToActive.get() != 0) {
-                       return (timeToActive.get() <= secs);
-
-               } else if (timeToInactive.isPresent() && timeToInactive.get() != 0) {
-                       return (timeToInactive.get() <= secs);
-               } else {
-                       return false;
-               }
-       }
-
-}
index 425d86d1792aff9de8647057f0258d67e6df4199..dd7fbf5854bdd76cc8e6abb0d307564c7758cd9e 100644 (file)
@@ -431,9 +431,9 @@ public class Drivetrain extends SubsystemBase {
     }
 
     // for current limit setting (brownout protection)
-    public void applyNewModuleCurrents(double steerCurrent, double driveCurren) {
+    public void applyNewModuleCurrents(double steerCurrent, double driveCurrent) {
         for (Module module : modules) { // iterate over our modules
-            module.setNewCurrentLimit(steerCurrent, driveCurren);
+            module.setNewCurrentLimit(steerCurrent, driveCurrent);
         }
     }
 
index f9db325d29007e2c300689bef33938493bfab328..49910f1e1d7538d3495848f75e37e92285658fd4 100644 (file)
@@ -359,14 +359,14 @@ public class Module implements ModuleIO{
         angleMotor.getConfigurator().apply(steerConfig); // apply
 
         // drive
-        CurrentLimitsConfigs dirveConfig = new CurrentLimitsConfigs();
-        dirveConfig.SupplyCurrentLimitEnable = DriveConstants.DRIVE_ENABLE_CURRENT_LIMIT;
-        dirveConfig.SupplyCurrentLimit = currentDrive;
-        dirveConfig.SupplyCurrentLowerLimit = currentDrive;
-        dirveConfig.SupplyCurrentLowerTime = DriveConstants.DRIVE_PEAK_CURRENT_DURATION;
-        dirveConfig.StatorCurrentLimit = currentDrive;
-        dirveConfig.StatorCurrentLimitEnable = DriveConstants.DRIVE_ENABLE_CURRENT_LIMIT;
-        driveMotor.getConfigurator().apply(dirveConfig); // apply
+        CurrentLimitsConfigs driveConfig = new CurrentLimitsConfigs();
+        driveConfig.SupplyCurrentLimitEnable = DriveConstants.DRIVE_ENABLE_CURRENT_LIMIT;
+        driveConfig.SupplyCurrentLimit = currentDrive;
+        driveConfig.SupplyCurrentLowerLimit = currentDrive;
+        driveConfig.SupplyCurrentLowerTime = DriveConstants.DRIVE_PEAK_CURRENT_DURATION;
+        driveConfig.StatorCurrentLimit = currentDrive;
+        driveConfig.StatorCurrentLimitEnable = DriveConstants.DRIVE_ENABLE_CURRENT_LIMIT;
+        driveMotor.getConfigurator().apply(driveConfig); // apply
     }
 
     private void configDriveMotor() {
index a48a97c127f4cd111668be217f9585a586be585a..f9dc0c6b257c1d9f796ae32a79527a5b1eed9406 100644 (file)
@@ -83,4 +83,4 @@ public class BrownOutConstants {
         DriveConstants.DRIVE_PEAK_CURRENT_LIMIT * 0.45  // lower drive movement
     );
 
-}
\ No newline at end of file
+}