From 220173a989c2bdc1a30098575e945545edaf06a0 Mon Sep 17 00:00:00 2001 From: QuackitsQuinn Date: Mon, 13 May 2024 16:05:06 -0500 Subject: [PATCH] more tiny fixes --- src/main/java/frc/robot/Constants.java | 2 ++ src/main/java/frc/robot/RobotContainer.java | 6 +++--- .../java/frc/robot/commands/SeekTargetWithLimelight.java | 2 +- .../robot/commands/auto/OnePieceAutoButItWorksISwear.java | 2 +- .../java/frc/robot/commands/lightstrip/EnabledLight.java | 2 +- src/main/java/frc/robot/subsystems/Drive.java | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4bf1b16..9263586 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -151,7 +151,9 @@ public static class DriveToAmpRed { public static final double FORWARD_WAIT_TIME = 0.5; } + /** Constants for the auto that drives bot to center of field. */ public static class DriveToCenter { + /** The time for the robot to drive to the center. */ public static final double DRIVE_CENTER_WAIT_TIME = 5.0; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index f355374..3efc3e2 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -392,11 +392,11 @@ public Command getAutonomousCommand() { } /** - * Gets the current alliance. Returns null if there is no alliance. + * Returns true if the robot is on the red alliance. False otherwise. * - * @return the current alliance. Nullable. + * @return True if the robot is on the red alliance. False otherwise. */ - public static boolean getAlliance() { + public static boolean isRedAlliance() { Optional alliance = DriverStation.getAlliance(); if (!alliance.isEmpty()) { return alliance.get() == Alliance.Red; diff --git a/src/main/java/frc/robot/commands/SeekTargetWithLimelight.java b/src/main/java/frc/robot/commands/SeekTargetWithLimelight.java index 20857ea..923d150 100644 --- a/src/main/java/frc/robot/commands/SeekTargetWithLimelight.java +++ b/src/main/java/frc/robot/commands/SeekTargetWithLimelight.java @@ -51,7 +51,7 @@ public void initialize() { this.oldPipelineNumber = limelight.getLimelightPipeline(); limelight.setLimelightPipeline(seekingPipelineNumber); - if (RobotContainer.getAlliance()) { + if (RobotContainer.isRedAlliance()) { this.rotationRadiansPerSecond = rotationRadiansPerSecond * -1; } } diff --git a/src/main/java/frc/robot/commands/auto/OnePieceAutoButItWorksISwear.java b/src/main/java/frc/robot/commands/auto/OnePieceAutoButItWorksISwear.java index a5f3216..35bae2e 100644 --- a/src/main/java/frc/robot/commands/auto/OnePieceAutoButItWorksISwear.java +++ b/src/main/java/frc/robot/commands/auto/OnePieceAutoButItWorksISwear.java @@ -22,7 +22,7 @@ public class OnePieceAutoButItWorksISwear extends SequentialCommandGroup { /** Creates a new OnePieceAutoButItWorksISwear. */ public OnePieceAutoButItWorksISwear() { - if (RobotContainer.getAlliance()) { + if (RobotContainer.isRedAlliance()) { addCommands(new DriveToAmpRed(), new DumpNote()); } else { addCommands(new DriveToAmpBlue(), new DumpNote()); diff --git a/src/main/java/frc/robot/commands/lightstrip/EnabledLight.java b/src/main/java/frc/robot/commands/lightstrip/EnabledLight.java index 4b58b6b..bc1af95 100644 --- a/src/main/java/frc/robot/commands/lightstrip/EnabledLight.java +++ b/src/main/java/frc/robot/commands/lightstrip/EnabledLight.java @@ -30,7 +30,7 @@ public EnabledLight() { @Override public void initialize() { - if (RobotContainer.getAlliance()) { + if (RobotContainer.isRedAlliance()) { robotLights.setStripColor(Constants.LightStrips.Colors.ENABLE_COLOR_RED_ALLIANCE); } else { robotLights.setStripColor(Constants.LightStrips.Colors.ENABLE_COLOR_BLUE_ALLIANCE); diff --git a/src/main/java/frc/robot/subsystems/Drive.java b/src/main/java/frc/robot/subsystems/Drive.java index 24194eb..1c21d49 100644 --- a/src/main/java/frc/robot/subsystems/Drive.java +++ b/src/main/java/frc/robot/subsystems/Drive.java @@ -79,7 +79,7 @@ public Drive() { /* This will flip the path being followed to the red side of the field. */ /* THE ORIGIN WILL REMAIN ON THE BLUE SIDE */ - return RobotContainer.getAlliance(); + return RobotContainer.isRedAlliance(); }, this /* Reference to this subsystem to set requirements */); }