]> git.taranathan.com Git - FRC2026.git/commitdiff
formatting, -imports
authoriefomit <timofei.stem@gmail.com>
Fri, 20 Mar 2026 02:08:48 +0000 (19:08 -0700)
committeriefomit <timofei.stem@gmail.com>
Fri, 20 Mar 2026 02:08:48 +0000 (19:08 -0700)
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/commands/led_comm/ChangeModeCommand.java
src/main/java/frc/robot/commands/led_comm/DefenseLightsCommand.java
src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java
src/main/java/frc/robot/commands/led_comm/PaintCommand.java
src/main/java/frc/robot/commands/led_comm/TurnOffLEDsCommand.java
src/main/java/frc/robot/subsystems/LED/LED.java

index 0bd19a9d82689d221287cfe5be130eb8cd2cff21..2ccbcb7b0332e7511ea1d7bff222f6c7b12e1519 100644 (file)
@@ -67,7 +67,7 @@ public class RobotContainer {
   private Intake intake = null;
 
   // this is inside addAuto()
-  //private Command auto = new DoNothing();
+  // private Command auto = new DoNothing();
 
   // Controllers are defined here
   private BaseDriverConfig driver = null;
@@ -137,18 +137,15 @@ public class RobotContainer {
         driver.configureControls();
         operator.configureControls();
 
-      
         registerCommands();
         PathGroupLoader.loadPathGroups();
-        
+
         initializeAutoBuilder();
         autoChooserInit();
 
         // put the Chooser on the SmartDashboard
         SmartDashboard.putData("Auto chooser", autoChooser);
 
-        
-
         if (turret != null) {
           turret.setDefaultCommand(new Superstructure(turret, drive, hood, shooter, spindexer));
         }
@@ -156,8 +153,8 @@ public class RobotContainer {
         break;
     }
 
-       if (intake != null && hood != null && turret != null)
-               CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
+    if (intake != null && hood != null && turret != null)
+      CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
 
     // This is really annoying so it's disabled
     DriverStation.silenceJoystickConnectionWarning(true);
@@ -243,16 +240,16 @@ public class RobotContainer {
 
   }
 
-  public void addAuto(String name){
-    try{
+  public void addAuto(String name) {
+    try {
       Command auto = new PathPlannerAuto(name);
       autoChooser.addOption(name, auto);
     }
     // is this the right one??
     catch (AutoBuilderException e) {
-          e.printStackTrace();
-          System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
-        }
+      e.printStackTrace();
+      System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
+    }
   }
 
   /**
@@ -263,7 +260,7 @@ public class RobotContainer {
     // add the options to the Chooser
     String defaultAuto = "Test default auto";
     String leftSideAuto = "Left Week V1";
-    String rightSideAuto = "Right Week V1";      
+    String rightSideAuto = "Right Week V1";
     String shootOnlyAuto = "Shoot Only Left Week V1";
 
     autoChooser.setDefaultOption("Default", new PathPlannerAuto(defaultAuto));
index 3c738abbada911cd40f6bda3530fda75d2938c1a..79a95bc8dafd573233aeb58d5fe4460bb49f0948 100644 (file)
@@ -3,33 +3,38 @@ package frc.robot.commands.led_comm;
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
 
-public class ChangeModeCommand extends Command{
+public class ChangeModeCommand extends Command {
     private int mode;
     private LED led;
-    public ChangeModeCommand(int mode, LED led){
+
+    public ChangeModeCommand(int mode, LED led) {
         this.mode = mode;
         this.led = led;
 
         addRequirements(led);
     }
-    public void initialize(){
+
+    public void initialize() {
         mode++;
     }
-    public void execute(){
-        if(mode == 0){
+
+    public void execute() {
+        if (mode == 0) {
             led.setLEDs(0, 0, 0);
-        }else if(mode == 1){
+        } else if (mode == 1) {
             led.setLEDs(0, 130, 12);
-        }else if(mode == 2){
+        } else if (mode == 2) {
             led.setLEDs(255, 255, 255);
-        }else{
+        } else {
             mode = 0;
         }
     }
-    public boolean isFinished(){
+
+    public boolean isFinished() {
         return false;
     }
-    public void end(){
+
+    public void end() {
 
     }
 }
index ca2ab4f5d39a6d346e0c28a4f00278086bbecb57..e6e061eec61d0fe78f608b52a13086e897b44d5d 100644 (file)
@@ -3,13 +3,13 @@ package frc.robot.commands.led_comm;
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
 
-public class DefenseLightsCommand extends Command{
+public class DefenseLightsCommand extends Command {
     private int counter;
     private int startOffset;
     private int length;
     private LED led;
 
-    public DefenseLightsCommand(LED led, int startOffset, int length){
+    public DefenseLightsCommand(LED led, int startOffset, int length) {
         this.led = led;
         this.startOffset = startOffset;
         this.length = length;
@@ -17,31 +17,31 @@ public class DefenseLightsCommand extends Command{
         addRequirements(led);
     }
 
-    public void initialize(){
+    public void initialize() {
         counter = 0;
     }
 
-    public void execute(){
+    public void execute() {
         counter++;
 
-        if(counter == 1){
-            //setLEDs(255, 0, 0);
+        if (counter == 1) {
+            // setLEDs(255, 0, 0);
             led.alternate(255, 0, 0, 0, 0, 255, 5, startOffset, length);
-        }else if(counter == 20){
-            //setLEDs(0, 0, 255);
+        } else if (counter == 20) {
+            // setLEDs(0, 0, 255);
             led.alternate(0, 0, 255, 255, 0, 0, 5, startOffset, length);
         }
-        if(counter >= 40){
+        if (counter >= 40) {
             counter = 0;
         }
-    
+
     }
 
-    public boolean isFinished(){
+    public boolean isFinished() {
         return false;
     }
 
-    public void end(boolean interrupted){
+    public void end(boolean interrupted) {
 
     }
 }
index 492a65afea13f501665f899e54890c87b657e9cf..f1e694eb28bbd0dfee5453cf93e358afb8aca801 100644 (file)
@@ -1,18 +1,10 @@
 package frc.robot.commands.led_comm;
 
 import edu.wpi.first.wpilibj.DriverStation;
-import edu.wpi.first.wpilibj.GenericHID;
-import edu.wpi.first.wpilibj.PS5Controller;
-import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj2.command.Command;
-import frc.robot.RobotContainer;
-import frc.robot.constants.Constants;
-import frc.robot.controls.BaseDriverConfig;
-import frc.robot.controls.PS5ControllerDriverConfig;
 import frc.robot.subsystems.LED.LED;
 import frc.robot.subsystems.drivetrain.Drivetrain;
 import frc.robot.util.Vision.Vision;
-import lib.controllers.PS5Controller.PS5Button;
 
 public class LEDDefaultCommand extends Command {
     private Vision vision;
@@ -21,8 +13,6 @@ public class LEDDefaultCommand extends Command {
     private Drivetrain drivetrain;
     private boolean allianceIsRed = DriverStation.getAlliance().get() == DriverStation.Alliance.Red;
 
-    
-
     public LEDDefaultCommand(LED led) {
         this.led = led;
         // this.outtake = outtake;
@@ -31,40 +21,43 @@ public class LEDDefaultCommand extends Command {
 
     @Override
     public void execute() {
-        
+
         double matchTime = DriverStation.getMatchTime();
         String gameData = DriverStation.getGameSpecificMessage();
-        // if (vision.oneCameraDisconnected() || DriverStation.isJoystickConnected(Constants.DRIVER_JOY)) {
-        //     // flash if camera disconnected
-        //     led.setStrobeLights(255, 100, 0);
-        //     controller.endRumble();
-        // } else 
+        // if (vision.oneCameraDisconnected() ||
+        // DriverStation.isJoystickConnected(Constants.DRIVER_JOY)) {
+        // // flash if camera disconnected
+        // led.setStrobeLights(255, 100, 0);
+        // controller.endRumble();
+        // } else
         if (fiveSecondsBeforeChange() && allianceIsRed) {
             // blink alliance color and rumble if red alliance 5 seconds before hub shifts
             led.setStrobeLights(255, 0, 0);
         } else if (fiveSecondsBeforeChange()) {
             // blink alliance color and rumble if blue alliance 5 seconds before hub shifts
             led.setStrobeLights(0, 0, 255);
-        } else 
-        if (playingDefense()) {
+        } else if (playingDefense()) {
             new DefenseLightsCommand(led, 0, 67);
-        } else 
-        if (DriverStation.isAutonomous() && allianceIsRed){
+        } else if (DriverStation.isAutonomous() && allianceIsRed) {
             // Dimmer light for auto in red alliance
             led.setLEDs(50, 0, 0);
-        } else if (DriverStation.isAutonomous()){
+        } else if (DriverStation.isAutonomous()) {
             // Dimmer light for auto in blue alliance
             led.setLEDs(0, 0, 50);
-        } else if ((allianceIsRed && gameData.equals("B") && matchTime <= 105 && matchTime >= 80) || (allianceIsRed && gameData.equals("B") && matchTime <= 55 && matchTime >= 30)) {
+        } else if ((allianceIsRed && gameData.equals("B") && matchTime <= 105 && matchTime >= 80)
+                || (allianceIsRed && gameData.equals("B") && matchTime <= 55 && matchTime >= 30)) {
             // turn light off for inactive hub if red alliance and blue inactive first
             led.setLEDs(0, 0, 0);
-        } else if ((allianceIsRed && gameData.equals("R") && matchTime <= 130 && matchTime >= 105) || (allianceIsRed && gameData.equals("R") && matchTime <= 80 && matchTime >= 55)) {
+        } else if ((allianceIsRed && gameData.equals("R") && matchTime <= 130 && matchTime >= 105)
+                || (allianceIsRed && gameData.equals("R") && matchTime <= 80 && matchTime >= 55)) {
             // turn light off for inactive hub if red alliance and red inactive first
             led.setLEDs(0, 0, 0);
-        } else if ((!allianceIsRed && gameData.equals("B") && matchTime <= 130 && matchTime >= 105) || (!allianceIsRed && gameData.equals("B") && matchTime <= 80 && matchTime >= 55)) {
+        } else if ((!allianceIsRed && gameData.equals("B") && matchTime <= 130 && matchTime >= 105)
+                || (!allianceIsRed && gameData.equals("B") && matchTime <= 80 && matchTime >= 55)) {
             // turn off lights for inactive hub if blue alliance and blue inactive first
             led.setLEDs(0, 0, 0);
-        } else if ((!allianceIsRed && gameData.equals("R") && matchTime <= 105 && matchTime >= 80) || (!allianceIsRed && gameData.equals("R") && matchTime <= 55 && matchTime >= 30)) {
+        } else if ((!allianceIsRed && gameData.equals("R") && matchTime <= 105 && matchTime >= 80)
+                || (!allianceIsRed && gameData.equals("R") && matchTime <= 55 && matchTime >= 30)) {
             // turn light off for inactive hub if blue alliance and red inactive first
             led.setLEDs(0, 0, 0);
         } else if (allianceIsRed) {
@@ -80,7 +73,8 @@ public class LEDDefaultCommand extends Command {
 
     private boolean fiveSecondsBeforeChange() {
         double time = DriverStation.getMatchTime();
-        if((time <= 135 && time >= 130) || (time <= 110 && time >= 105) || (time <= 85 && time >= 80) || (time <= 60 && time >= 55) || (time <= 35 && time >= 30)){
+        if ((time <= 135 && time >= 130) || (time <= 110 && time >= 105) || (time <= 85 && time >= 80)
+                || (time <= 60 && time >= 55) || (time <= 35 && time >= 30)) {
             return true;
         }
         return false;
index 67640195af53698dc9bcced8452f009618b33c40..04c2cd2fe5eebb5cff0cdaac165dc2915b6371f1 100644 (file)
@@ -3,28 +3,32 @@ package frc.robot.commands.led_comm;
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
 
-public class PaintCommand extends Command{
+public class PaintCommand extends Command {
     private int start;
     private int end;
     private LED led;
 
-    public PaintCommand(LED led, int start, int end){
+    public PaintCommand(LED led, int start, int end) {
         this.led = led;
         this.end = end;
         this.start = start;
 
         addRequirements(led);
     }
-    public void initialize(){
+
+    public void initialize() {
         led.setSection(0, 0, 255, start, end);
     }
-    public void execute(){
+
+    public void execute() {
         led.setTwoColorWave(30, 0, 80, 255, 255, 255);
     }
-    public boolean isFinished(){
+
+    public boolean isFinished() {
         return false;
     }
-    public void end(boolean interrupted){
+
+    public void end(boolean interrupted) {
 
     }
 }
index 8a914337ddded298c0d47791239ea8c0a402be65..22398afc53a118c29d9de887a407782c4e798541 100644 (file)
@@ -3,23 +3,28 @@ package frc.robot.commands.led_comm;
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
 
-public class TurnOffLEDsCommand extends Command{
+public class TurnOffLEDsCommand extends Command {
     private LED led;
-    public TurnOffLEDsCommand(LED led){
+
+    public TurnOffLEDsCommand(LED led) {
         this.led = led;
 
         addRequirements(led);
     }
-    public void initialize(){
+
+    public void initialize() {
         led.setLEDs(0, 0, 0);
     }
-    public void execute(){
+
+    public void execute() {
 
     }
-    public boolean isFinished(){
+
+    public boolean isFinished() {
         return false;
     }
-    public void end(boolean interrupted){
+
+    public void end(boolean interrupted) {
 
     }
 }
index b35e83eab1767c277d58b17360692370a86d5382..456dfa5613f77be6815248c98e878fa6b703e738 100644 (file)
@@ -5,7 +5,6 @@ import com.ctre.phoenix6.configs.CANdleFeaturesConfigs;
 import com.ctre.phoenix6.configs.LEDConfigs;
 import com.ctre.phoenix6.controls.ControlRequest;
 import com.ctre.phoenix6.controls.SolidColor;
-import com.ctre.phoenix6.controls.StrobeAnimation;
 import com.ctre.phoenix6.hardware.CANdle;
 import com.ctre.phoenix6.signals.Enable5VRailValue;
 import com.ctre.phoenix6.signals.LossOfSignalBehaviorValue;
@@ -25,8 +24,8 @@ public class LED extends SubsystemBase {
        private double counter = 0;
 
        private double waveOffset = 0;
-    private final double waveSpeed = 0.08;
-    private final double waveFrequency = 0.25;
+       private final double waveSpeed = 0.08;
+       private final double waveFrequency = 0.25;
        private double period = 10;
        private double midLine = 127.5;
 
@@ -129,38 +128,40 @@ public class LED extends SubsystemBase {
 
        public void setTwoColorWave(int r1, int g1, int b1, int r2, int g2, int b2) {
                for (int i = 0; i < stripLength; i++) {
-       
+
                        double wave = (Math.sin(i * waveFrequency + waveOffset) + 1) / 2.0;
-                       double inverseBias = 5;     // higher = more color 2
+                       double inverseBias = 5; // higher = more color 2
                        wave = 1 - Math.pow(1 - wave, inverseBias);
-       
-                       int r = (int)(r1 * wave + r2 * (1 - wave));
-                       int g = (int)(g1 * wave + g2 * (1 - wave));
-                       int b = (int)(b1 * wave + b2 * (1 - wave));
+
+                       int r = (int) (r1 * wave + r2 * (1 - wave));
+                       int g = (int) (g1 * wave + g2 * (1 - wave));
+                       int b = (int) (b1 * wave + b2 * (1 - wave));
                        setSection(r, g, b, i, i + 1);
                }
-       
+
                waveOffset += waveSpeed;
        }
        // public void setTwoColorWave(int r1, int g1, int b1, int r2, int g2, int b2) {
-       //      for (int i = 0; i < stripLength; i++) {
-       
-       //              double wave = 127.5 * Math.sin( ((2*Math.PI)/period) * (i + waveOffset)) + midLine;
-       //              double inverseBias = 5;     // higher = more color 2
-       //              wave = 1 - Math.pow(1 - wave, inverseBias);
-       
-       //              //int r = (int)(r1 * wave + r2 * (1 - wave));
-       //              //int g = (int)(g1 * wave + g2 * (1 - wave));
-       //              //int b = (int)(b1 * wave + b2 * (1 - wave));
-       //              // int b = (int)wave;
-       //              int b = 255;
-       //              int g = (int)(127.5 * Math.sin( ((2*Math.PI)/period) * (i + waveOffset + 5)) + midLine);
-       //              //int g = r;
-
-       //              setSection(0, g, b, i, i + 1);
-       //      }
-       
-       //      waveOffset += waveSpeed;
+       // for (int i = 0; i < stripLength; i++) {
+
+       // double wave = 127.5 * Math.sin( ((2*Math.PI)/period) * (i + waveOffset)) +
+       // midLine;
+       // double inverseBias = 5; // higher = more color 2
+       // wave = 1 - Math.pow(1 - wave, inverseBias);
+
+       // //int r = (int)(r1 * wave + r2 * (1 - wave));
+       // //int g = (int)(g1 * wave + g2 * (1 - wave));
+       // //int b = (int)(b1 * wave + b2 * (1 - wave));
+       // // int b = (int)wave;
+       // int b = 255;
+       // int g = (int)(127.5 * Math.sin( ((2*Math.PI)/period) * (i + waveOffset + 5))
+       // + midLine);
+       // //int g = r;
+
+       // setSection(0, g, b, i, i + 1);
+       // }
+
+       // waveOffset += waveSpeed;
        // }
 
        /**