From 0a6fdac36325d3ed4ab606a008ed1bba606e38a2 Mon Sep 17 00:00:00 2001 From: Ethan Porter Date: Sat, 23 Mar 2024 09:40:29 -0400 Subject: [PATCH] fix auto not runing --- src/main/java/frc/robot/controls/DriverControls.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/controls/DriverControls.java b/src/main/java/frc/robot/controls/DriverControls.java index 4a00137c..17ba54b5 100644 --- a/src/main/java/frc/robot/controls/DriverControls.java +++ b/src/main/java/frc/robot/controls/DriverControls.java @@ -400,7 +400,9 @@ public static void setupMainControls(CommandXboxController mainController) { )); BooleanEvent stateChangedEvent = - new BooleanEvent(eventLoop, () -> DevilBotState.stateChanged()); + new BooleanEvent( + eventLoop, + () -> (DevilBotState.stateChanged()) && DevilBotState.getState() != State.AUTO); Trigger stateChangedEventTrigger = stateChangedEvent.rising().castTo(Trigger::new); stateChangedEventTrigger.onTrue(getResetSubsystemsCommand());