diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index dbedcf8..f198faa 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -184,6 +184,9 @@ public enum RobotEdition { @AutoLogOutput boolean haveAutosGenerated = false; private final LoggedDashboardChooser autoChooser = new LoggedDashboardChooser<>("Autos"); + @AutoLogOutput(key = "Shooter/Hood/Has Zeroed") + private boolean hoodZeroed = false; + // temporarily override map with empty map to avoid collisions with reefscape elements // unfortunately this also turns off collisions with walls but that's fine // TODO update once rebuilt is added to maplesim @@ -528,7 +531,19 @@ private void addControllerBindings(Indexer indexer, Shooter shooter, Intake inta // TODO add binding for climb // current zero shooter hood - driver.b().whileTrue(shooter.runCurrentZeroing()); + new Trigger(() -> !hoodZeroed) + .or(driver.b()) + .whileTrue( + shooter + .runCurrentZeroing() + .finallyDo( + interrupted -> { + if (!interrupted) { + hoodZeroed = true; + } else { + hoodZeroed = false; + } + })); new Trigger(() -> intake.beambreak()).onTrue(driver.rumbleCmd(1, 1).withTimeout(0.5));