Class AsymmetricTrapezoidProfile
java.lang.Object
org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
org.chsrobotics.lib.trajectory.motionProfile.AsymmetricTrapezoidProfile
- Direct Known Subclasses:
TrapezoidProfile
A MotionProfile that allows for smooth motion between two states, generated with acceleration,
velocity, and deceleration constraints.
The dx/dt of this motion (velocity) forms the trapezoid shape on a graph. The particular elements of motion are velocity and acceleration limited, with acceleration limiting having different constraints for the initial phase of motion ("maxAcceleration"), and the final phase of motion ("maxDeceleration").
The most useful practical application of this is use defining the setpoint for a PID (or similar) controller, to avoid control effort saturation or the initial spike in input from the P term.
Also could be used to meet physical constraints from a mechanism (can't go too fast or the wires might tangle, has to decelerate at a different rate depending on the location in its track, etc...).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA data class to hold the maximum allowable rates for the output of a AsymmetricTrapezoidProfile.Nested classes/interfaces inherited from class org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
MotionProfile.State -
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricTrapezoidProfile(AsymmetricTrapezoidProfile.Constraints constraints, MotionProfile.State target) Constructs an AsymmetricTrapezoidProfile with an initial position and velocity of 0,0.AsymmetricTrapezoidProfile(AsymmetricTrapezoidProfile.Constraints constraints, MotionProfile.State target, MotionProfile.State initial) Constructs an AsymmetricTrapezoidProfile. -
Method Summary
Methods inherited from class org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
getPhases, sample, totalTime
-
Constructor Details
-
AsymmetricTrapezoidProfile
public AsymmetricTrapezoidProfile(AsymmetricTrapezoidProfile.Constraints constraints, MotionProfile.State target) Constructs an AsymmetricTrapezoidProfile with an initial position and velocity of 0,0.- Parameters:
constraints- The constraints on the profile, like maximum velocity.target- The desired state when the profile is complete.
-
AsymmetricTrapezoidProfile
public AsymmetricTrapezoidProfile(AsymmetricTrapezoidProfile.Constraints constraints, MotionProfile.State target, MotionProfile.State initial) Constructs an AsymmetricTrapezoidProfile.- Parameters:
constraints- The constraints on the profile, like maximum velocity.target- The desired state when the profile is complete.initial- The initial state (usually the current state).
-