[wpimath] Fix quintic spline generation from control vectors (#2762)

This does not introduce any breaking changes for teams that used the TrajectoryGenerator API for
quintic splines with poses.

The GetQuinticControlVectorsFromWaypoints() method was removed because it is not possible for us (or
would require breaking changes to the shape of the splines) to generate only one quintic control vector
per Pose2d.  Users who actually have control vectors directly (i.e. not from Pose2d objects, but a
dashboard such as PathWeaver) should have the number of control vectors correspond to the number of
"waypoints" and can call GetQuinticSplinesFromControlVectors() directly.
This commit is contained in:
Prateek Machiraju
2020-10-04 15:51:48 -04:00
committed by GitHub
parent 96e26247d7
commit bf26656547
7 changed files with 89 additions and 39 deletions

View File

@@ -31,9 +31,7 @@ class QuinticHermiteSplineTest {
//var start = System.nanoTime();
// Generate and parameterize the spline.
var controlVectors = SplineHelper.getQuinticControlVectorsFromWaypoints(List.of(a, b));
var spline = SplineHelper.getQuinticSplinesFromControlVectors(
controlVectors.toArray(new Spline.ControlVector[0]))[0];
var spline = SplineHelper.getQuinticSplinesFromWaypoints(List.of(a, b))[0];
var poses = SplineParameterizer.parameterize(spline);
// End the timer.