From: iefomit Date: Fri, 6 Feb 2026 01:01:17 +0000 (-0800) Subject: small fixes X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=bfb9635d265d522e04345fbda0c6bb019596ddd5;p=FRC2026.git small fixes --- diff --git a/src/main/java/frc/robot/util/ShooterPhysics.java b/src/main/java/frc/robot/util/ShooterPhysics.java index f6b7c32..f6381c3 100644 --- a/src/main/java/frc/robot/util/ShooterPhysics.java +++ b/src/main/java/frc/robot/util/ShooterPhysics.java @@ -111,7 +111,6 @@ public class ShooterPhysics { double magnitude2d = onGround.getNorm(); double pitch = new Translation2d(magnitude2d, velocity.getZ()).getAngle().getRadians(); - pitch %= Math.PI * 2; double speed = velocity.getDistance(Translation3d.kZero); return new TurretState(yaw, pitch, speed, height); @@ -204,9 +203,9 @@ public class ShooterPhysics { double guessSpeed = guessVelocity.getNorm(); double difference = minSpeed - guessSpeed; - // we've already hit minimum height and are trying to go lower - if (guess <= target.getZ() && difference < 0) - throw new RuntimeException("Incorrect minimum speed calculation in ShooterPhysics.java"); + // If we're at minimum height and still need more speed, it's impossible + if (guess <= target.getZ() && difference > 0) + throw new RuntimeException("Impossible to achieve minimum speed for target " + target); if (Math.abs(difference) <= tolerance) return cvtShot(guessVelocity, guess); diff --git a/src/test/java/frc/robot/util/ShooterPhysicsTest.java b/src/test/java/frc/robot/util/ShooterPhysicsTest.java index b08981c..d034278 100644 --- a/src/test/java/frc/robot/util/ShooterPhysicsTest.java +++ b/src/test/java/frc/robot/util/ShooterPhysicsTest.java @@ -143,11 +143,6 @@ class ShooterPhysicsTest { .exitVel()); } - @Test - public void angleTest() { - - } - @Test public void simpleConstraintsTest() { Constraints constraints = new Constraints(3, 20, .1, Math.PI - .1);