core / com.acmerobotics.roadrunner.profile / MotionProfileGenerator / generateSimpleMotionProfile

generateSimpleMotionProfile

@JvmStatic @JvmOverloads fun generateSimpleMotionProfile(start: MotionState, goal: MotionState, maxVel: Double, maxAccel: Double, maxJerk: Double = 0.0, overshoot: Boolean = false): MotionProfile (source)

Generates a simple motion profile with constant maxVel, maxAccel, and maxJerk. If maxJerk is zero, an acceleration-limited profile will be generated instead of a jerk-limited one. If constraints can't be obeyed, there are two possible fallbacks: If overshoot is true, then two profiles will be concatenated (the first one overshoots the goal and the second one reverses back to reach the goal). Otherwise, the highest order constraint (e.g., max jerk for jerk-limited profiles) is repeatedly violated until the goal is achieved.

Parameters

start - start motion state

goal - goal motion state

maxVel - maximum velocity

maxAccel - maximum acceleration

maxJerk - maximum jerk

overshoot - if true overshoot otherwise violate constraints (see description above)