Class MaxVelocityConstraint

java.lang.Object
edu.wpi.first.math.trajectory.constraint.MaxVelocityConstraint
All Implemented Interfaces:
TrajectoryConstraint

public class MaxVelocityConstraint extends Object implements TrajectoryConstraint
Represents a constraint that enforces a max velocity. This can be composed with the EllipticalRegionConstraint or RectangularRegionConstraint to enforce a max velocity in a region.
  • Constructor Details

    • MaxVelocityConstraint

      public MaxVelocityConstraint(double maxVelocity)
      Constructs a new MaxVelocityConstraint.
      Parameters:
      maxVelocity - The max velocity in m/s.
  • Method Details

    • getMaxVelocity

      public double getMaxVelocity(Pose2d pose, double curvature, double velocity)
      Description copied from interface: TrajectoryConstraint
      Returns the max velocity given the current pose and curvature.
      Specified by:
      getMaxVelocity in interface TrajectoryConstraint
      Parameters:
      pose - The pose at the current point in the trajectory.
      curvature - The curvature at the current point in the trajectory rad/m.
      velocity - The velocity at the current point in the trajectory before constraints are applied in m/s.
      Returns:
      The absolute maximum velocity.
    • getMinMaxAcceleration

      public TrajectoryConstraint.MinMax getMinMaxAcceleration(Pose2d pose, double curvature, double velocity)
      Description copied from interface: TrajectoryConstraint
      Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.
      Specified by:
      getMinMaxAcceleration in interface TrajectoryConstraint
      Parameters:
      pose - The pose at the current point in the trajectory.
      curvature - The curvature at the current point in the trajectory rad/m.
      velocity - The speed at the current point in the trajectory in m/s.
      Returns:
      The min and max acceleration bounds.