// now we need to satisfy the speed constraint
TurretState withMinSpeed = withMinimumSpeed(robotVelocity, robotToTarget);
+ if (withMinSpeed.exitVel() > constraints.maxVel())
+ return Optional.empty();
// ordered such that the first element is valid and the second is not
Pair<TurretState, TurretState> newRange;
var val2 = ShooterPhysics.getConstrainedParams(Translation2d.kZero, new Translation3d(10, 10, 3), constraints2);
assertTrue(val2.isPresent());
assertEquals(45, Units.radiansToDegrees(val2.get().pitch()), .1);
+
+ // something impossible
+ Constraints constraints3 = new Constraints(3, 3, Units.degreesToRadians(45), Math.PI / 2 - .1);
+ var val3 = ShooterPhysics.getConstrainedParams(Translation2d.kZero, new Translation3d(10, 10, 3), constraints3);
+ assertTrue(val3.isEmpty(), val3.toString());
}
// test using a simple physics simulation