From 9cfa4d8ba73ab0ff85460ad333bce161a3f6ee8f Mon Sep 17 00:00:00 2001 From: iefomit Date: Mon, 26 Jan 2026 17:50:15 -0800 Subject: [PATCH] make code build --- gradlew | 0 .../commands/led_comm/LEDDefaultCommand.java | 49 ++++++++++--------- .../commands/led_comm/LEDSensorCommand.java | 23 ++++----- 3 files changed, 37 insertions(+), 35 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java b/src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java index e54cf26..8f52e00 100644 --- a/src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java +++ b/src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java @@ -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; diff --git a/src/main/java/frc/robot/commands/led_comm/LEDSensorCommand.java b/src/main/java/frc/robot/commands/led_comm/LEDSensorCommand.java index e5d88a1..95b5b05 100644 --- a/src/main/java/frc/robot/commands/led_comm/LEDSensorCommand.java +++ b/src/main/java/frc/robot/commands/led_comm/LEDSensorCommand.java @@ -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); } } -- 2.39.5