Interface TrajectoryConstraint

All Known Implementing Classes:
CentripetalAccelerationConstraint, DifferentialDriveKinematicsConstraint, DifferentialDriveVoltageConstraint, EllipticalRegionConstraint, MaxVelocityConstraint, MecanumDriveKinematicsConstraint, RectangularRegionConstraint, SwerveDriveKinematicsConstraint

public interface TrajectoryConstraint
An interface for defining user-defined velocity and acceleration constraints while generating trajectories.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  TrajectoryConstraint.MinMax
    Represents a minimum and maximum acceleration.
  • Method Summary

    Modifier and Type Method Description
    double getMaxVelocityMetersPerSecond​(Pose2d poseMeters, double curvatureRadPerMeter, double velocityMetersPerSecond)
    Returns the max velocity given the current pose and curvature.
    TrajectoryConstraint.MinMax getMinMaxAccelerationMetersPerSecondSq​(Pose2d poseMeters, double curvatureRadPerMeter, double velocityMetersPerSecond)
    Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.
  • Method Details

    • getMaxVelocityMetersPerSecond

      double getMaxVelocityMetersPerSecond​(Pose2d poseMeters, double curvatureRadPerMeter, double velocityMetersPerSecond)
      Returns the max velocity given the current pose and curvature.
      Parameters:
      poseMeters - The pose at the current point in the trajectory.
      curvatureRadPerMeter - The curvature at the current point in the trajectory.
      velocityMetersPerSecond - The velocity at the current point in the trajectory before constraints are applied.
      Returns:
      The absolute maximum velocity.
    • getMinMaxAccelerationMetersPerSecondSq

      TrajectoryConstraint.MinMax getMinMaxAccelerationMetersPerSecondSq​(Pose2d poseMeters, double curvatureRadPerMeter, double velocityMetersPerSecond)
      Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.
      Parameters:
      poseMeters - The pose at the current point in the trajectory.
      curvatureRadPerMeter - The curvature at the current point in the trajectory.
      velocityMetersPerSecond - The speed at the current point in the trajectory.
      Returns:
      The min and max acceleration bounds.