[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

@@ -36,13 +36,13 @@ class SplineHelper {
const Pose2d& end);
/**
* Returns quintic control vectors from a set of waypoints.
* Returns quintic splines from a set of waypoints.
*
* @param waypoints The waypoints
* @return List of control vectors
* @return List of quintic splines.
*/
static std::vector<Spline<5>::ControlVector>
QuinticControlVectorsFromWaypoints(const std::vector<Pose2d>& waypoints);
static std::vector<QuinticHermiteSpline> QuinticSplinesFromWaypoints(
const std::vector<Pose2d>& waypoints);
/**
* Returns a set of cubic splines corresponding to the provided control