From d47cf27633a916669ba0ba7a6c5b29f6e784b444 Mon Sep 17 00:00:00 2001 From: aarav18 Date: Fri, 18 Mar 2022 22:31:59 -0600 Subject: [PATCH] turret reset before auto climb --- src/main/java/frc4388/robot/RobotContainer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 9d8f029..719c3da 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -359,6 +359,10 @@ public class RobotContainer { // toggle manual mode and autonomous mode based on the current control mode new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value) + .whenPressed(new InstantCommand(() -> { + if (this.currentControlMode.equals(SubsystemMode.CLIMBER)) { m_robotTurret.gotoZero(); } + }, m_robotTurret)) + .whenPressed(new InstantCommand(() -> { if (this.currentControlMode.equals(SubsystemMode.SHOOTER)) { this.currentTurretMode = ControlMode.MANUAL; } if (this.currentControlMode.equals(SubsystemMode.CLIMBER)) { this.currentClimberMode = ControlMode.AUTONOMOUS; }