Class ExponentialProfile

java.lang.Object
edu.wpi.first.math.trajectory.ExponentialProfile

public class ExponentialProfile
extends Object
A exponential curve-shaped velocity profile.

While this class can be used for a profiled movement from start to finish, the intended usage is to filter a reference's dynamics based on state-space model dynamics. To compute the reference obeying this constraint, do the following.

Initialization:


 ExponentialProfile.Constraints constraints =
   ExponentialProfile.Constraints.fromCharacteristics(kMaxV, kV, kA);
 ExponentialProfile.State previousProfiledReference =
   new ExponentialProfile.State(initialReference, 0.0);
 ExponentialProfile profile = new ExponentialProfile(constraints);
 

Run on update:


 previousProfiledReference =
 profile.calculate(timeSincePreviousUpdate, previousProfiledReference, unprofiledReference);
 

where `unprofiledReference` is free to change between calls. Note that when the unprofiled reference is within the constraints, `calculate()` returns the unprofiled reference unchanged.

Otherwise, a timer can be started to provide monotonic values for `calculate()` and to determine when the profile has completed via `isFinished()`.