Class DrivetrainSplineTrajectory
java.lang.Object
org.wpilib.math.trajectory.Trajectory<DrivetrainSplineSample>
org.wpilib.math.trajectory.DrivetrainSplineTrajectory
A trajectory for spline-based path following.
-
Field Summary
Fields inherited from class Trajectory
duration, samples -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a DrivetrainSplineTrajectory.DrivetrainSplineTrajectory(DrivetrainSplineSample[] samples) Constructs a DrivetrainSplineTrajectory. -
Method Summary
Modifier and TypeMethodDescriptionConcatenates this trajectory with another trajectory.interpolate(DrivetrainSplineSample start, DrivetrainSplineSample end, double t) Interpolates between two samples using constant-acceleration kinematic equations.relativeTo(Pose2d other) Returns a new trajectory that is relative to the given pose.transformBy(Transform2d transform) Transforms all poses in the trajectory by the given transform.Methods inherited from class Trajectory
end, getSamples, sampleAt, sampleAt, start
-
Constructor Details
-
DrivetrainSplineTrajectory
Constructs a DrivetrainSplineTrajectory.- Parameters:
samples- the samples of the trajectory. Order does not matter as they will be ordered internally.
-
DrivetrainSplineTrajectory
Constructs a DrivetrainSplineTrajectory.- Parameters:
samples- the samples of the trajectory. Order does not matter as they will be ordered internally.
-
-
Method Details
-
interpolate
public DrivetrainSplineSample interpolate(DrivetrainSplineSample start, DrivetrainSplineSample end, double t) Interpolates between two samples using constant-acceleration kinematic equations.- Specified by:
interpolatein classTrajectory<DrivetrainSplineSample>- Parameters:
start- The starting sample.end- The ending sample.t- The interpolation parameter between 0 and 1.- Returns:
- The interpolated sample.
-
transformBy
Transforms all poses in the trajectory by the given transform.- Specified by:
transformByin classTrajectory<DrivetrainSplineSample>- Parameters:
transform- The transform to apply to the trajectory.- Returns:
- The transformed trajectory.
-
concatenate
Concatenates this trajectory with another trajectory.- Specified by:
concatenatein classTrajectory<DrivetrainSplineSample>- Parameters:
other- the other trajectory to concatenate with this one.- Returns:
- a new trajectory that is the concatenation of this trajectory and the other trajectory.
-
relativeTo
Returns a new trajectory that is relative to the given pose.- Specified by:
relativeToin classTrajectory<DrivetrainSplineSample>- Parameters:
other- the pose to which the trajectory should be relative.- Returns:
- a new trajectory relative to the given pose.
-