Class TrajectoryInterpolater


  • public final class TrajectoryInterpolater
    extends java.lang.Object
    Class used to parameterize a trajectory by time.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Trajectory timeParameterizeTrajectory​(java.util.List<edu.wpi.first.math.spline.PoseWithCurvature> points, java.util.List<TrajectoryConstraint> constraints, double startVelocityMetersPerSecond, double endVelocityMetersPerSecond, double maxVelocityMetersPerSecond, double maxAccelerationMetersPerSecondSq, boolean reversed)
      Parameterize the trajectory by time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • timeParameterizeTrajectory

        public static Trajectory timeParameterizeTrajectory​(java.util.List<edu.wpi.first.math.spline.PoseWithCurvature> points,
                                                            java.util.List<TrajectoryConstraint> constraints,
                                                            double startVelocityMetersPerSecond,
                                                            double endVelocityMetersPerSecond,
                                                            double maxVelocityMetersPerSecond,
                                                            double maxAccelerationMetersPerSecondSq,
                                                            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.
        startVelocityMetersPerSecond - The start velocity for the trajectory.
        endVelocityMetersPerSecond - The end velocity for the trajectory.
        maxVelocityMetersPerSecond - The max velocity for the trajectory.
        maxAccelerationMetersPerSecondSq - The max acceleration for the trajectory.
        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.