From d59e2f06da838e35c4d5fe211fa31b2523b63520 Mon Sep 17 00:00:00 2001 From: Michael Mikovsky <77305074+Astatin3@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:53:15 -0700 Subject: [PATCH] fix: manual elevator methods needs to check if the joystick is zero. --- .../frc4388/robot/subsystems/Elevator.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Elevator.java b/src/main/java/frc4388/robot/subsystems/Elevator.java index 1324c42..eb0366d 100644 --- a/src/main/java/frc4388/robot/subsystems/Elevator.java +++ b/src/main/java/frc4388/robot/subsystems/Elevator.java @@ -32,6 +32,9 @@ public class Elevator extends SubsystemBase { private double elevatorRefrence = 0; private double endeffectorRefrence = 0; + private boolean elevatorManualStop = true; + private boolean endefectorManualStop = true; + private DigitalInput basinBeamBreak; private DigitalInput endeffectorLimitSwitch; @@ -219,11 +222,23 @@ public class Elevator extends SubsystemBase { } public void manualElevatorVel(double velocity) { - elevatorMotor.set(velocity); + if (Math.abs(velocity) > 0.1) { + elevatorMotor.set(velocity); + } + if (!elevatorManualStop) { + elevatorManualStop = true; + elevatorMotor.set(0); + } } public void manualEndeffectorVel(double velocity) { - endeffectorMotor.set(velocity); + if (Math.abs(velocity) > 0.1) { + endeffectorMotor.set(velocity); + } + if (!endefectorManualStop) { + endefectorManualStop = true; + endeffectorMotor.set(0); + } } @Override @@ -235,7 +250,7 @@ public class Elevator extends SubsystemBase { SmartDashboard.putString("State", currentState.toString()); if (currentState == CoordinationState.Waiting) { - // periodicWaiting(); + periodicWaiting(); } else if (currentState == CoordinationState.WatingBeamTripped) { // periodicWaitingTripped(); } else if (currentState == CoordinationState.Ready) {