Class DrivetrainSplineTrajectoryParameterizer
java.lang.Object
org.wpilib.math.trajectory.DrivetrainSplineTrajectoryParameterizer
Class used to parameterize a drivetrain spline trajectory by time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException for trajectory generation failure. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrivetrainSplineTrajectoryparameterize(List<PoseWithCurvature> points, List<TrajectoryConstraint> constraints, double startVelocity, double endVelocity, double maxVelocity, double maxAcceleration, boolean reversed) Parameterize the trajectory by time.
-
Method Details
-
parameterize
public static DrivetrainSplineTrajectory parameterize(List<PoseWithCurvature> points, List<TrajectoryConstraint> constraints, double startVelocity, double endVelocity, double maxVelocity, double maxAcceleration, boolean reversed) Parameterize the trajectory by time. This is where the velocity profile is generated.The derivation of the algorithm used can be found here.
- Parameters:
points- Reference to the spline points.constraints- A vector of various velocity and acceleration. constraints.startVelocity- The start velocity for the trajectory in m/s.endVelocity- The end velocity for the trajectory in m/s.maxVelocity- The max velocity for the trajectory in m/s.maxAcceleration- The max acceleration for the trajectory in m/s².reversed- Whether the robot should move backwards. Note that the robot will still move from a -> b -> ... -> z as defined in the waypoints.- Returns:
- The trajectory.
-