Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/gkc-2024' into gkc-constant-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
quackitsquinn committed Apr 29, 2024
2 parents 5d56048 + 762eba4 commit 4a307a5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public static class Auto {
/** The amount of time that we want to run the fire note command in auto. */
public static final double FIRE_NOTE_FOR_TIME = 4.0;

/** Time in seconds that we delay our taxi in the delayed taxi auto. */
public static final double TAXI_DELAY_TIME = 10.0;

/** Constants for the DriveToAmpBlue auto */
public static class DriveToAmpBlue {
/** The time for the robot to drive left towards the amp. */
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import frc.robot.commands.RunIntake;
import frc.robot.commands.RunIntakeReverse;
import frc.robot.commands.StartCamera;
import frc.robot.commands.auto.DelayedTaxiAuto;
import frc.robot.commands.auto.DriveToCenterAuto;
import frc.robot.commands.auto.MoveAwayFromAmp;
import frc.robot.commands.auto.OnePieceAuto;
Expand Down Expand Up @@ -285,6 +286,9 @@ public class RobotContainer {
/** Singleton instance of {@link TaxiAuto} for the whole robot. */
public static TaxiAuto taxiAuto = new TaxiAuto();

/** Singleton instance of {@link DelayedTaxiAuto} for the whole robot. */
public static DelayedTaxiAuto delayedTaxiAuto = new DelayedTaxiAuto();

/** Singleton instance of {@link ClearPDPStickyFaults} for the whole robot. */
public static ClearPDPStickyFaults clearPDPStickyFaults = new ClearPDPStickyFaults();

Expand Down Expand Up @@ -359,6 +363,8 @@ private void configureAuto() {

autoChooser.addOption("NO INTAKE drive to center", driveToCenterAuto);

autoChooser.addOption("Taxi with 10 second delay", delayedTaxiAuto);

Shuffleboard.getTab("Driver").add("Choose Auto Routine", autoChooser);
}

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/frc/robot/commands/auto/DelayedTaxiAuto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

/*
* Asimov's Laws:
* The First Law: A robot may not injure a human being or, through inaction, allow a human being to come to harm.
* The Second Law: A robot must obey the orders given it by human beings except where such orders would conflict with the First Law.
* The Third Law: A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
*/

package frc.robot.commands.auto;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import frc.robot.Constants;

/** Taxi auto that waits a bit before it taxis. */
public class DelayedTaxiAuto extends SequentialCommandGroup {
/** Creates a new DelayedTaxiAuto. */
public DelayedTaxiAuto() {
addCommands(new WaitCommand(Constants.Auto.TAXI_DELAY_TIME), new TaxiAuto());
}
}

0 comments on commit 4a307a5

Please sign in to comment.