[wpimath] Exit early when parameterizing malformed spline (#6827)

Currently, a max iteration heuristic is used to determine when a spline
is malformed. Instead, we can report a failure immediately if dx and dy
are too small, because the heading won't be accurate either.

Fixes #6826.
This commit is contained in:
Tyler Veness
2024-07-12 21:52:28 -07:00
committed by GitHub
parent e00bb2f07b
commit deb5f3d7af
8 changed files with 61 additions and 36 deletions

View File

@@ -36,7 +36,7 @@ class CubicHermiteSplineTest {
var poses = new ArrayList<PoseWithCurvature>();
poses.add(splines[0].getPoint(0.0));
poses.add(splines[0].getPoint(0.0).get());
for (var spline : splines) {
poses.addAll(SplineParameterizer.parameterize(spline));