[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

@@ -30,7 +30,7 @@ class CubicHermiteSplineTest : public ::testing::Test {
SplineHelper::CubicSplinesFromControlVectors(startCV, waypoints, endCV);
std::vector<Spline<3>::PoseWithCurvature> poses;
poses.push_back(splines[0].GetPoint(0.0));
poses.push_back(splines[0].GetPoint(0.0).value());
for (auto&& spline : splines) {
auto x = SplineParameterizer::Parameterize(spline);