core / com.acmerobotics.roadrunner.profile / MotionSegment

MotionSegment

class MotionSegment

Segment of a motion profile with constant acceleration.

Parameters

start - start motion state

dt - time delta

Constructors

<init>

MotionSegment(start: MotionState, dt: Double)

Segment of a motion profile with constant acceleration.

Properties

dt

val dt: Double

time delta

start

val start: MotionState

start motion state

Functions

end

fun end(): MotionState

Returns the MotionState at the end of the segment (time dt).

flipped

fun flipped(): MotionSegment

Returns a flipped (negated) version of the segment.

get

operator fun get(t: Double): MotionState

Returns the MotionState at time t.

reversed

fun reversed(): MotionSegment

Returns a reversed version of the segment. Note: it isn't possible to reverse a segment completely so this method only guarantees that the start and end velocities will be swapped.

toString

fun toString(): String