diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 4cf72c5..561fdb4 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "2024RobotCode"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 283; - public static final String GIT_SHA = "1bbe432c459d5a47ba7632f4ecd21b430021a73d"; - public static final String GIT_DATE = "2024-07-08 19:55:42 EDT"; + public static final int GIT_REVISION = 284; + public static final String GIT_SHA = "b1b6e3205d31d1312f8405f3bbea5539a3c4c823"; + public static final String GIT_DATE = "2024-07-08 23:36:46 EDT"; public static final String GIT_BRANCH = "vision-subsytem"; - public static final String BUILD_DATE = "2024-07-08 20:00:53 EDT"; - public static final long BUILD_UNIX_TIME = 1720483253403L; + public static final String BUILD_DATE = "2024-07-09 12:42:08 EDT"; + public static final long BUILD_UNIX_TIME = 1720543328895L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 6430721..6011436 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -38,7 +38,7 @@ public static Mode getMode() { }; } - public static final Mode currentMode = Mode.REAL; + public static final Mode currentMode = Mode.SIM; public static final boolean tuningMode = true; public static final String CANBUS = "CAN Bus 2"; public static final double LOOP_PERIOD_SECS = 0.02; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index efa347c..a59994a 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -79,6 +79,7 @@ import frc.robot.subsystems.led.LED; import frc.robot.subsystems.led.LED_IO; import frc.robot.subsystems.led.LED_IOCANdle; +import frc.robot.subsystems.led.LED_IOSim; import frc.robot.subsystems.pivot.Pivot; import frc.robot.subsystems.pivot.PivotIO; import frc.robot.subsystems.pivot.PivotIOSim; @@ -223,7 +224,7 @@ public RobotContainer() { new LeafBlowerIO() {}); elevator = new Elevator(new ElevatorIOSim()); pivot = new Pivot(new PivotIOSim()); - led = new LED(new LED_IO() {}); + led = new LED(new LED_IOSim()); break; default: @@ -725,7 +726,7 @@ private void driverControls() { () -> -driveController.getLeftX(), () -> -driveController.getRightX(), () -> false, - () -> false))); + manipLeftBumper))); driveRightBumper.onFalse( new InstantCommand(() -> led.setState(LED_STATE.BLUE)) @@ -766,7 +767,7 @@ private void driverControls() { () -> -driveController.getLeftY(), () -> -driveController.getLeftX(), () -> -driveController.getRightX(), - driveLeftBumper, + () -> true, manipLeftBumper))); driveLeftBumper.onFalse( new InstantCommand(() -> led.setState(LED_STATE.BLUE)) diff --git a/src/main/java/frc/robot/subsystems/LED/LED_IOSim.java b/src/main/java/frc/robot/subsystems/LED/LED_IOSim.java new file mode 100644 index 0000000..d09ca3b --- /dev/null +++ b/src/main/java/frc/robot/subsystems/LED/LED_IOSim.java @@ -0,0 +1,37 @@ +package frc.robot.subsystems.led; + +import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj.DriverStation.Alliance; +import frc.robot.Constants; +import frc.robot.Constants.LED_STATE; + +public class LED_IOSim implements LED_IO { + LED_STATE ledState; + + public LED_IOSim() { + ledState = Constants.LED_STATE.BLUE; + setLEDState(ledState); + } + + @Override + public void updateInputs(LED_IOInputs inputs) { + inputs.ledState = ledState; + } + + @Override + public void noBumpersPressed() { + if (DriverStation.getAlliance().get() == Alliance.Blue) { + setLEDState(LED_STATE.BLUE); + // led.set(Constants.LEDConstants.COLOR_BLUE); + + } else { + setLEDState(LED_STATE.RED); + // led.set(Constants.LEDConstants.COLOR_RED); + } + } + + @Override + public void setLEDState(LED_STATE state) { + ledState = state; + } +}