You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Both solver strategies now available** via `TrajectorySolver.SolveMode` enum:
8
+
-**`CONSTRAINT`** (default): Two-constraint algebraic solver. Computes exact (pitch, velocity) from target geometry + rim clearance. Fastest and most deterministic.
9
+
-**`SWEEP`**: Improved angle sweep. Tests every pitch from min→max at 0.5° steps, calculates the exact velocity needed per angle, simulates with full RK4 physics, refines with binary-search velocity correction, and picks the angle with the **smallest miss distance**. No scoring, no weights — pure accuracy selection.
10
+
-**`CONSTRAINT` mode automatically falls back to `SWEEP`** if the constraint solver fails (e.g., no valid clearance found within +3.0m). The sweep acts as a robust fallback.
11
+
-**`SWEEP` mode does NOT fall back** — it runs the sweep only.
12
+
13
+
### New API
14
+
-**`solver.setSolveMode(TrajectorySolver.SolveMode.CONSTRAINT)`** — switch between modes at runtime
15
+
-**`solver.getSolveMode()`** — query current mode
16
+
- Both modes share the same validation pipeline: collision, clearance, arc height, hit detection, flyover, entry angle, and velocity refinement.
17
+
18
+
## 1.5.0
19
+
20
+
### Constraint-Based Solver
21
+
-**Replaced the angle sweep with a two-constraint algebraic solver**. Instead of testing 70+ pitch angles and picking the best, the solver now computes the **single exact (pitch, velocity) pair** from two physical constraints:
22
+
1. Ball passes through target center at `(distance, heightDiff)`
23
+
2. Ball clears the rim edge at `(distance − radius, heightDiff + clearance)`
24
+
- This eliminates scoring, searching, and miss-distance comparison entirely. One deterministic solution per solve — no ambiguity.
25
+
-**Full physics verification**: The vacuum analytical solution is then simulated with RK4 (air drag, Magnus spin, game piece properties) and refined with 8-iteration binary-search velocity correction. Same physics fidelity, dramatically simpler selection.
26
+
-**Obstacle avoidance via clearance escalation**: If the analytical trajectory collides with an obstacle or fails clearance checks, the solver increases `rimClearance` in 0.25m steps (up to +3.0m) until the arc is high enough to clear. No sweep fallback needed.
27
+
-**Moving target refinement**: For moving robots, the solver iterates twice with actual time-of-flight to refine the lead prediction — same concept as TurretCalculator's `iterativeMovingShotFromFunnelClearance`.
28
+
-**`solveForCurrentRpm()` also updated**: Uses the high-arc angle formula `θ = atan((v² + √(v⁴ − g(gd² + 2hv²))) / (gd))` instead of sweeping. Direct analytical solution for fixed-velocity scenarios.
29
+
30
+
### New Configuration
31
+
-**`SolverConstants.rimClearanceMeters`** (default 0.15m): Height above the target rim the ball must achieve at the rim edge. Controls arc steepness — larger = steeper entry, smaller = flatter. One ball radius (~0.075m) is the physical minimum.
32
+
-**`computeConstraintSolution(d, h, r, c)`**: New static method exposing the two-constraint parabolic solver. Returns `[pitchRadians, velocityMps]` for any geometry.
33
+
34
+
## 1.4.1
35
+
36
+
### Scoring Removed — Pure Accuracy Selection
37
+
-**Removed all scoring**: The solver no longer scores candidates. Instead, it filters valid trajectories (collision-free, on-target, correct entry angle, no flyover) and picks the one **closest to dead center** by miss distance. No points, no weights, no tuning — just the most accurate shot.
38
+
-**Selection by miss distance**: Among all valid candidates, the solver selects the trajectory with the smallest horizontal distance from the target center at the rim-crossing plane. A hit 2cm off-center always beats a hit 5cm off-center, regardless of entry angle, height, or flight time.
39
+
-**`ScoringWeights` deprecated**: The class and `setScoringWeights()`/`getScoringWeights()` are `@Deprecated`. The solver ignores them entirely.
40
+
-**`scoreCandidate()` removed**: The internal scoring method is gone. No replacement — selection is a simple `missDistance < bestMissDistance` comparison.
41
+
42
+
### Debug Info Updated
43
+
-`SolveDebugInfo` now tracks **miss distance** (meters from center) instead of score points.
44
+
- New `getBestMissDistance()` and `CandidateInfo.getMissDistance()` methods.
45
+
-`getBestScore()` and `getScore()` are `@Deprecated` (return miss distance for compatibility).
46
+
- Debug tables and summaries show `miss=X.XXXXm` instead of `score=X.X`.
47
+
48
+
### Tighter Hit Detection
49
+
-**Default tolerance multipliers reduced to 1.0** (`hoopToleranceMultiplier`, `basketDescentToleranceMultiplier`). The ball must land within the actual target radius — no more inflated acceptance zones.
50
+
-**Rim-plane crossing always detected**: Simulation stops when the ball descends through targetZ regardless of horizontal distance.
51
+
-**Velocity binary-search refinement**: 8-iteration binary search finds the lowest valid velocity for the steepest possible entry angle.
52
+
53
+
### Other
54
+
- Updated `ExampleShooter`: removed all weight configuration, tightened target radius to 0.45m, debug output uses miss distance instead of score.
* @deprecated Since 1.4.1 — the solver now uses a deterministic accuracy-first\n * scoring system. This class is retained for API compatibility only.\n */
0 commit comments