]> git.taranathan.com Git - FRC2026.git/commitdiff
make code build
authoriefomit <timofei.stem@gmail.com>
Tue, 27 Jan 2026 01:50:15 +0000 (17:50 -0800)
committeriefomit <timofei.stem@gmail.com>
Tue, 27 Jan 2026 01:50:15 +0000 (17:50 -0800)
gradlew [changed mode: 0644->0755]
src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java
src/main/java/frc/robot/commands/led_comm/LEDSensorCommand.java

diff --git a/gradlew b/gradlew
old mode 100644 (file)
new mode 100755 (executable)
index e54cf26c7127a3398f67618d39d703188939cea2..8f52e0031f4ec8ef0de6430c6906f9f85bb2ad7c 100644 (file)
@@ -4,21 +4,21 @@ import edu.wpi.first.wpilibj.DriverStation;
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
 import frc.robot.subsystems.drivetrain.Drivetrain;
-import frc.robot.subsystems.outtake.Outtake;
+// import frc.robot.subsystems.outtake.Outtake; // TODO: Outtake subsystem not implemented on current robot
 import frc.robot.util.Vision.Vision;
 
 public class LEDDefaultCommand extends Command {
     private Vision vision;
     private LED led;
-    private Outtake outtake;
+    // private Outtake outtake;
     private Drivetrain drivetrain;
-    //TODO: change this to actual climb coordinate
+    // TODO: change this to actual climb coordinate
     private double climbYCoordinate = 1.08;
     private boolean allianceIsRed = DriverStation.getAlliance().get() == DriverStation.Alliance.Red;
 
-    public LEDDefaultCommand(LED led, Outtake outtake, Drivetrain drivetrain, Vision vision){
+    public LEDDefaultCommand(LED led, Drivetrain drivetrain, Vision vision) {
         this.led = led;
-        this.outtake = outtake;
+        // this.outtake = outtake; // TODO: Outtake subsystem not yet implemented
         this.drivetrain = drivetrain;
         this.vision = vision;
 
@@ -26,41 +26,42 @@ public class LEDDefaultCommand extends Command {
     }
 
     @Override
-    public void execute(){
-        if (climbAligned()){
-            //When aligned to climb
+    public void execute() {
+        if (climbAligned()) {
+            // When aligned to climb
             led.setTwoColorWave(255, 0, 100, 100, 0, 255);
-        }else if(vision.oneCameraDisconnected()){
-            //flash if camera disconnected
+        } else if (vision.oneCameraDisconnected()) {
+            // flash if camera disconnected
             led.setStrobeLights(255, 0, 0);
-        }else if (playingDefense()){
-            //When playing defense
+        } else if (playingDefense()) {
+            // When playing defense
             led.defenseLights();
         }
-        else if (outtake.coralLoaded()){
-            //When coral detected
-            led.setLEDs(0, 255, 0);
-        }else if(allianceIsRed){
-            //Red alliance
+
+        // else if (outtake.coralLoaded()){
+        // //When coral detected
+        // led.setLEDs(0, 255, 0);
+        // }
+        else if (allianceIsRed) {
+            // Red alliance
             led.setTwoColorWave(255, 0, 0, 255, 255, 255);
-        }else{
-            //Blue alliance
+        } else {
+            // Blue alliance
             led.setTwoColorWave(0, 0, 255, 255, 255, 255);
         }
     }
 
-    private boolean climbAligned(){
+    private boolean climbAligned() {
         double yCoordinate = drivetrain.getPose().getY();
         return Math.abs(yCoordinate - climbYCoordinate) < 0.03;
     }
 
-    private boolean playingDefense(){
+    private boolean playingDefense() {
         double xCoordinate = drivetrain.getPose().getX();
         double xCoordinateHalfway = 50;
-        if (allianceIsRed){
+        if (allianceIsRed) {
             return xCoordinate > xCoordinateHalfway;
-        }
-        else if (!allianceIsRed) {
+        } else if (!allianceIsRed) {
             return xCoordinate < xCoordinateHalfway;
         }
         return false;
index e5d88a1763fcb0f26fe5b246fc88b79ff202e6ee..95b5b051a7bf5abaca6d659b74abf4e3289dc5ac 100644 (file)
@@ -2,28 +2,29 @@ package frc.robot.commands.led_comm;
 
 import edu.wpi.first.wpilibj2.command.Command;
 import frc.robot.subsystems.LED.LED;
-import frc.robot.subsystems.LaserCAN.Sensor;
+// import frc.robot.subsystems.LaserCAN.Sensor; // TODO: LaserCAN Sensor subsystem not implemented on current robot
 
-public class LEDSensorCommand extends Command{
+public class LEDSensorCommand extends Command {
     private LED led;
-    private Sensor sensor;
+    // private Sensor sensor;
     private int alliance = 0;
 
-    public LEDSensorCommand(LED led, Sensor sensor, int alliance){
+    public LEDSensorCommand(LED led, int alliance) {
         this.led = led;
-        this.sensor = sensor;
+        // this.sensor = sensor;
 
-        addRequirements(led, sensor);
+        addRequirements(led);
     }
 
     @Override
     public void execute() {
-        if (sensor.detected()){
-            led.setLEDs(0, 255, 0);
-        }
-        else if(alliance == 0){
+        // if (sensor.detected()){
+        // led.setLEDs(0, 255, 0);
+        // }
+        // else
+        if (alliance == 0) {
             led.setLEDs(0, 0, 255);
-        }else{
+        } else {
             led.setLEDs(255, 0, 0);
         }
     }