Class TrapezoidProfile


public class TrapezoidProfile extends AsymmetricTrapezoidProfile
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...).

  • 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

      public TrapezoidProfile(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.
      Parameters:
      constraints - The maximum allowed velocity and accelerations.
      goalState - The target state of the profile.