Skip to content

Commit

Permalink
fix duplicated constants
Browse files Browse the repository at this point in the history
  • Loading branch information
willitcode committed May 13, 2024
1 parent 13fe373 commit bfcf1be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
21 changes: 6 additions & 15 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,13 @@ public static class Auto {
/** Time in seconds that we wait for TaxiLongAuto to end. */
public static final double TAXI_LONG_WAIT_TIME = 2.0;

/** Constants for the DriveToAmpBlue auto */
public static class DriveToAmpBlue {
/** The time for the robot to drive left towards the amp. */
public static final double LEFT_WAIT_TIME = 1;
/** Constants for the DriveToAmp autos */
public static class DriveToAmp {
/** The time that the robot spends snapping to the appropriate angle. */
public static final double SNAPPING_TIME = 1;

/** The time for the robot to drive forwards towards the amp. */
public static final double FORWARD_WAIT_TIME = 0.5;
}

/** Constants for the DriveToAmpRed auto */
public static class DriveToAmpRed {
/** The time for the robot to drive left towards the amp. */
public static final double LEFT_WAIT_TIME = 1;

/** The time for the robot to drive forwards towards the amp. */
public static final double FORWARD_WAIT_TIME = 0.5;
/** The time for the robot to drive towards the amp. */
public static final double DRIVE_TO_AMP_TIME = 0.5;
}

/** Constants for the auto that drives bot to center of field. */
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/auto/DriveToAmpBlue.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class DriveToAmpBlue extends SequentialCommandGroup {
public DriveToAmpBlue() {
super(
new ParallelDeadlineGroup(
new WaitCommand(Constants.Auto.DriveToAmpBlue.LEFT_WAIT_TIME),
new WaitCommand(Constants.Auto.DriveToAmp.SNAPPING_TIME),
new DriveFieldOrientedHeadingSnapping(
() -> 0.0,
() -> 0.0,
Expand All @@ -34,7 +34,7 @@ public DriveToAmpBlue() {
() -> true,
() -> false)),
new ParallelDeadlineGroup(
new WaitCommand(Constants.Auto.DriveToAmpBlue.FORWARD_WAIT_TIME),
new WaitCommand(Constants.Auto.DriveToAmp.DRIVE_TO_AMP_TIME),
new DriveFieldOrientedHeadingSnapping(
() -> 0.0,
() -> 1.0,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/auto/DriveToAmpRed.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class DriveToAmpRed extends SequentialCommandGroup {
public DriveToAmpRed() {
super(
new ParallelDeadlineGroup(
new WaitCommand(Constants.Auto.DriveToAmpRed.LEFT_WAIT_TIME),
new WaitCommand(Constants.Auto.DriveToAmp.SNAPPING_TIME),
new DriveFieldOrientedHeadingSnapping(
() -> 0.0,
() -> 0.0,
Expand All @@ -34,7 +34,7 @@ public DriveToAmpRed() {
() -> false,
() -> true)),
new ParallelDeadlineGroup(
new WaitCommand(Constants.Auto.DriveToAmpRed.FORWARD_WAIT_TIME),
new WaitCommand(Constants.Auto.DriveToAmp.DRIVE_TO_AMP_TIME),
new DriveFieldOrientedHeadingSnapping(
() -> 0.0,
() -> -1.0,
Expand Down

0 comments on commit bfcf1be

Please sign in to comment.