Skip to content

Commit

Permalink
more tiny fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
quackitsquinn committed May 13, 2024
1 parent e7bf22a commit 220173a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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> alliance = DriverStation.getAlliance();
if (!alliance.isEmpty()) {
return alliance.get() == Alliance.Red;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void initialize() {
this.oldPipelineNumber = limelight.getLimelightPipeline();
limelight.setLimelightPipeline(seekingPipelineNumber);

if (RobotContainer.getAlliance()) {
if (RobotContainer.isRedAlliance()) {
this.rotationRadiansPerSecond = rotationRadiansPerSecond * -1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 */);
}
Expand Down

0 comments on commit 220173a

Please sign in to comment.