]> git.taranathan.com Git - FRC2026.git/commitdiff
few bug fixes
authoriefomit <timofei.stem@gmail.com>
Fri, 6 Feb 2026 00:24:14 +0000 (16:24 -0800)
committeriefomit <timofei.stem@gmail.com>
Fri, 6 Feb 2026 00:24:14 +0000 (16:24 -0800)
gradlew [changed mode: 0644->0755]
src/main/java/frc/robot/util/ShooterPhysics.java

diff --git a/gradlew b/gradlew
old mode 100644 (file)
new mode 100755 (executable)
index 40fec43d30448fe3cc1ef3b3fcf0d87088ffb0fd..7335b9d1780fb636195472e53b1216bc2f980987 100644 (file)
@@ -57,7 +57,7 @@ public class ShooterPhysics {
 
                // the only reason this is empty is if the highest posible trajectory is too low
                // to intersect the goal
-               Optional<TurretState> withMaxPitchOpt = withAngle(robotVelocity, robotToTarget, constraints.minPitch());
+               Optional<TurretState> withMaxPitchOpt = withAngle(robotVelocity, robotToTarget, constraints.maxPitch());
                if (withMaxPitchOpt.isEmpty())
                        return Optional.empty();
                TurretState withMaxPitch = withMaxPitchOpt.get();
@@ -91,7 +91,7 @@ public class ShooterPhysics {
                // now we binary search the new range
                TurretState lastValid = newRange.getFirst();
                // use a 5cm tolerance
-               while (Math.abs(newRange.getFirst().height() - newRange.getSecond().height()) < .05) {
+               while (Math.abs(newRange.getFirst().height() - newRange.getSecond().height()) > .05) {
                        double avgHeight = (newRange.getFirst().height() + newRange.getSecond().height()) / 2;
                        TurretState guess = cvtShot(getRequiredExitVelocity(robotVelocity, robotToTarget, avgHeight), avgHeight);
                        if (guess.satisfies(constraints)) {