Class TrapezoidProfile
java.lang.Object
org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
org.chsrobotics.lib.trajectory.motionProfile.AsymmetricTrapezoidProfile
org.chsrobotics.lib.trajectory.motionProfile.TrapezoidProfile
Represents a special case of an
AsymmetricTrapezoidProfile
where the maxAcceleration and
maxDeceleration constraints are the same.
A motion profile that allows for smooth motion between two states. The dx/dt of this motion (velocity) forms the trapezoid shape on a graph. The particular elements of motion are velocity and acceleration limited.
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, mechanism has too much mass to decelerate too quickly, etc...).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Data class to hold the maximum allowed rates for the output of a TrapezoidProfile.Nested classes/interfaces inherited from class org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
MotionProfile.State
-
Constructor Summary
ConstructorsConstructorDescriptionTrapezoidProfile
(TrapezoidProfile.Constraints constraints, MotionProfile.State goalState) Constructs a Trapezoid profile out of given constraints, a goal state, and an initial state of zero position and velocity.TrapezoidProfile
(TrapezoidProfile.Constraints constraints, MotionProfile.State goalState, MotionProfile.State initialState) Constructs a TrapezoidProfile out of given constraints, an initial state, and a goal state. -
Method Summary
Methods inherited from class org.chsrobotics.lib.trajectory.motionProfile.MotionProfile
getPhases, sample, totalTime
-
Constructor Details
-
TrapezoidProfile
public TrapezoidProfile(TrapezoidProfile.Constraints constraints, MotionProfile.State goalState, MotionProfile.State initialState) Constructs a TrapezoidProfile out of given constraints, an initial state, and a goal state.- Parameters:
constraints
- The maximum allowed velocity and accelerations.initialState
- The initial state of the profile.goalState
- The target state of the profile.
-
TrapezoidProfile
Constructs a Trapezoid profile out of given constraints, a goal state, and an initial state of zero position and velocity.- Parameters:
constraints
- The maximum allowed velocity and accelerations.goalState
- The target state of the profile.
-