Package-level declarations

Types

Link copied to clipboard
fun interface AccelConstraint

Constraint on robot acceleration during motion profiling.

Link copied to clipboard
class AngularVelConstraint(val maxAngVel: Double) : VelConstraint

Velocity constraint based on maximum angular velocity.

Link copied to clipboard
@Serializable
@SerialName(value = "CancelableProfile")
class CancelableProfile(val baseProfile: DisplacementProfile, val disps: List<Double>, val minAccels: List<Double>) : Profile

Displacement profile that can be canceled at any time to yield a new displacement profile that achieves the final velocity as soon as possible and then promptly ends.

Link copied to clipboard
class CompositeAccelConstraint(val constraints: List<AccelConstraint>, val offsets: List<Double>) : AccelConstraint

Composite acceleration constraint that applies different constraints at different path positions.

Link copied to clipboard
class CompositeVelConstraint(val constraints: List<VelConstraint>, val offsets: List<Double>) : VelConstraint

Composite velocity constraint that applies different constraints at different path positions.

Link copied to clipboard
@Serializable
@SerialName(value = "DisplacementProfile")
data class DisplacementProfile(val disps: List<Double>, val vels: List<Double>, val accels: List<Double>) : Profile

Acceleration-limited motion profile parameterized by displacement.

Link copied to clipboard

Composite velocity constraint that enforces the minimum of multiple constraints.

Link copied to clipboard
interface Profile
Link copied to clipboard
class ProfileAccelConstraint(val minAccel: Double, val maxAccel: Double) : AccelConstraint

Acceleration constraint defined by constant minimum and maximum acceleration values.

Link copied to clipboard
data class ProfileParams(val dispResolution: Double, val angResolution: Double, val angSamplingEps: Double)

Parameters for motion profile sampling and angular sampling.

Link copied to clipboard
@Serializable
@SerialName(value = "TimeProfile")
data class TimeProfile @JvmOverloads constructor(val dispProfile: DisplacementProfile, val times: List<Double> = timeScan(dispProfile)) : Profile

Acceleration-limited motion profile parameterized by time.

Link copied to clipboard

Velocity constraint based on maximum translational velocity.

Link copied to clipboard
fun interface VelConstraint

Constraint on robot velocity during motion profiling.

Functions

Link copied to clipboard

Converts available voltage to acceleration using the acceleration constant kA.

Link copied to clipboard
fun constantProfile(length: Double, beginEndVel: Double, maxVel: Double, minAccel: Double, maxAccel: Double): CancelableProfile

Computes an exact, time-optimal profile.

Link copied to clipboard
fun createDisplacementPoints(samples: List<Double>, pathLength: Double): List<Double>

Creates displacement interval endpoints from sample points. Adds midpoints between samples to ensure proper interval representation.

Link copied to clipboard
fun createOptimalDisplacementProfile(params: ProfileParams, path: PosePath, beginVel: Double, velConstraint: VelConstraint, accelConstraint: AccelConstraint): DisplacementProfile

Creates a complete displacement profile by generating forward and backward passes and merging them for optimal performance.

Link copied to clipboard
fun createSimpleDisplacementProfile(length: Double, beginVel: Double, maxVel: (Double) -> Double, maxAccel: (Double) -> Double, resolution: Double): DisplacementProfile

Generates a simple displacement profile with uniform sampling and constant constraints.

Link copied to clipboard
fun createVoltageConstrainedProfile(length: Double, beginEndVel: Double, kV: Double, kA: Double, kS: Double, maxVoltage: (Double) -> Double, resolution: Double): CancelableProfile

Generates a complete voltage-constrained profile with cancellation capability. This creates forward and backward profiles, merges them, and adds cancellation constraints.

Link copied to clipboard
fun evaluateBackwardConstraintsAtSamples(path: PosePath, samples: List<Double>, velConstraint: VelConstraint, accelConstraint: AccelConstraint): Pair<List<Double>, List<Double>>

Evaluates constraints for backward profile generation. Returns maximum velocities and minimum accelerations.

Link copied to clipboard
fun evaluateConstraintsAtSamples(path: PosePath, samples: List<Double>, velConstraint: VelConstraint, accelConstraint: AccelConstraint): Pair<List<Double>, List<Double>>

Evaluates velocity and acceleration constraints at the given sample points. Returns maximum velocities and accelerations for forward profile generation.

Link copied to clipboard
fun generateBackwardProfile(disps: List<Double>, maxVels: List<Double>, endVel: Double, minAccels: List<Double>): DisplacementProfile

Generates a backward displacement profile by working backwards from the end. This is implemented by reversing the problem and using the forward algorithm.

Link copied to clipboard
fun generateCancelableProfile(disps: List<Double>, beginEndVel: Double, maxVels: List<Double>, minAccels: List<Double>, maxAccels: List<Double>): CancelableProfile

Computes an approximately time-optimal profile from sampled constraints.

fun generateCancelableProfile(length: Double, beginEndVel: Double, maxVel: (Double) -> Double, minAccel: (Double) -> Double, maxAccel: (Double) -> Double, resolution: Double): CancelableProfile

Computes an approximately time-optimal profile by sampling the constraints according to the resolution resolution.

Link copied to clipboard
fun generateForwardProfile(disps: List<Double>, beginVel: Double, maxVels: List<Double>, maxAccels: List<Double>): DisplacementProfile

Generates a forward displacement profile by enforcing velocity and acceleration constraints. Uses a greedy approach to maximize velocity while respecting constraints.

Link copied to clipboard

Generates a backward profile based on path constraints.

Link copied to clipboard
fun generatePathBasedForwardProfile(params: ProfileParams, path: PosePath, beginVel: Double, velConstraint: VelConstraint, accelConstraint: AccelConstraint): DisplacementProfile

Generates a forward profile based on path constraints by sampling the path and evaluating constraints at each sample point.

Link copied to clipboard

Generates sample points along the path based on displacement and angular resolution. Combines uniform displacement sampling with adaptive angular sampling.

Link copied to clipboard
fun generateSimpleBackwardProfile(length: Double, maxVel: (Double) -> Double, endVel: Double, minAccel: (Double) -> Double, resolution: Double): DisplacementProfile

Generates a simple backward profile with uniform sampling.

Generates a voltage-constrained backward profile.

Link copied to clipboard

Generates a voltage-constrained forward profile using motor model parameters.

Link copied to clipboard
fun maxAccelerationFromVoltage(availableVoltage: Double, velocityVoltage: Double, kA: Double): Double

Calculates the maximum acceleration achievable with the given voltage and motor constants.

Link copied to clipboard
fun maxVelocityFromVoltage(availableVoltage: Double, kV: Double): Double

Calculates the maximum velocity achievable with the given voltage and motor constants.

Link copied to clipboard

Merges two displacement profiles by taking the minimum velocity at every point. This is used to combine forward and backward profiles to create a time-optimal profile.

Link copied to clipboard

Combines two displacement profiles end-to-end. Requires that the ending velocity of the first profile matches the beginning velocity of the second.

Link copied to clipboard
fun samplePathByRotation(path: PosePath, angResolution: Double, eps: Double): List<Double>
Link copied to clipboard

Converts available voltage to velocity using the velocity constant kV.

Link copied to clipboard

Converts acceleration to required voltage using the acceleration constant kA.

Link copied to clipboard

Converts velocity to required voltage using the velocity constant kV.