Package edu.wpi.first.math.trajectory
Class ExponentialProfile
java.lang.Object
edu.wpi.first.math.trajectory.ExponentialProfile
A exponential curveshaped 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 statespace 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()`.

Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Profile constraints.static class
Profile timing.static class
Profile state. 
Constructor Summary
ConstructorDescriptionExponentialProfile
(ExponentialProfile.Constraints constraints) Constructs an ExponentialProfile. 
Method Summary
Modifier and TypeMethodDescriptioncalculate
(double t, ExponentialProfile.State current, ExponentialProfile.State goal) Calculates the position and velocity for the profile at a time t where the current state is at time t = 0.Calculates the point after which the fastest way to reach the goal state is to apply input in the opposite direction.Calculates the time it will take for this profile to reach the inflection point, and the time it will take for this profile to reach the goal state.double
timeLeftUntil
(ExponentialProfile.State current, ExponentialProfile.State goal) Calculates the time it will take for this profile to reach the goal state.

Constructor Details

ExponentialProfile
Constructs an ExponentialProfile. Parameters:
constraints
 The constraints on the profile, like maximum input.


Method Details

calculate
public ExponentialProfile.State calculate(double t, ExponentialProfile.State current, ExponentialProfile.State goal) Calculates the position and velocity for the profile at a time t where the current state is at time t = 0. Parameters:
t
 How long to advance from the current state toward the desired state.current
 The current state.goal
 The desired state when the profile is complete. Returns:
 The position and velocity of the profile at time t.

calculateInflectionPoint
public ExponentialProfile.State calculateInflectionPoint(ExponentialProfile.State current, ExponentialProfile.State goal) Calculates the point after which the fastest way to reach the goal state is to apply input in the opposite direction. Parameters:
current
 The current state.goal
 The desired state when the profile is complete. Returns:
 The position and velocity of the profile at the inflection point.

timeLeftUntil
Calculates the time it will take for this profile to reach the goal state. Parameters:
current
 The current state.goal
 The desired state when the profile is complete. Returns:
 The total duration of this profile.

calculateProfileTiming
public ExponentialProfile.ProfileTiming calculateProfileTiming(ExponentialProfile.State current, ExponentialProfile.State goal) Calculates the time it will take for this profile to reach the inflection point, and the time it will take for this profile to reach the goal state. Parameters:
current
 The current state.goal
 The desired state when the profile is complete. Returns:
 The timing information for this profile.
