From 863565c7029c8248fc694991b82e13d794b84fe6 Mon Sep 17 00:00:00 2001 From: Brandon <83319404+BrandonS09@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:52:29 +0000 Subject: [PATCH] if speeds is 0 in armTeleop, returns, fix to #24? --- src/main/java/org/carlmontrobotics/commands/ArmTeleop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/carlmontrobotics/commands/ArmTeleop.java b/src/main/java/org/carlmontrobotics/commands/ArmTeleop.java index 5ab448fc..da606b70 100644 --- a/src/main/java/org/carlmontrobotics/commands/ArmTeleop.java +++ b/src/main/java/org/carlmontrobotics/commands/ArmTeleop.java @@ -49,7 +49,9 @@ public void execute() { double speeds = getRequestedSpeeds(); double currTime = Timer.getFPGATimestamp(); double deltaT = currTime - lastTime; - + if (speeds == 0){ + return; + } double goalArmRad = goalState.position + speeds * deltaT; goalArmRad = MathUtil.clamp(goalArmRad, UPPER_ANGLE_LIMIT_RAD, LOWER_ANGLE_LIMIT_RAD); goalArmRad = MathUtil.clamp(goalArmRad, armSubsystem.getArmPos() + ARM_TELEOP_MAX_GOAL_DIFF_FROM_CURRENT_RAD,