Skip to content

Commit

Permalink
Only allow coast when override is switched during disable
Browse files Browse the repository at this point in the history
  • Loading branch information
suryatho committed Mar 7, 2024
1 parent 5774ee3 commit 3df8355
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/org/littletonrobotics/frc2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public class RobotContainer {

private boolean podiumShotMode = false;
private boolean trapScoreMode = true;
private boolean coastOverride = false;

// Dashboard inputs
private final LoggedDashboardChooser<Command> autoChooser =
Expand Down Expand Up @@ -257,9 +258,17 @@ public RobotContainer() {
superstructure = new Superstructure(arm, climber, backpackActuator);

// Set up subsystems
arm.setOverrides(armDisable, armCoast);
// Set up coast override
armCoast
.and(DriverStation::isDisabled)
.onTrue(Commands.runOnce(() -> coastOverride = true).ignoringDisable(true));
armCoast
.negate()
.or(DriverStation::isEnabled)
.onTrue(Commands.runOnce(() -> coastOverride = false).ignoringDisable(true));
arm.setOverrides(armDisable, () -> coastOverride);
climber.setCoastOverride(() -> coastOverride);
RobotState.getInstance().setLookaheadDisable(lookaheadDisable);
climber.setCoastOverride(armCoast);
flywheels.setPrepareShootSupplier(
() -> {
return DriverStation.isTeleopEnabled()
Expand Down

0 comments on commit 3df8355

Please sign in to comment.