core / com.acmerobotics.roadrunner.profile / MotionSegment

MotionSegment

class MotionSegment (source)

Segment of a motion profile with constant acceleration.

Parameters

start - start motion state

dt - time delta

Constructors

<init>

Segment of a motion profile with constant acceleration.

MotionSegment(start: MotionState, dt: Double)

Properties

dt

time delta

val dt: Double

start

start motion state

val start: MotionState

Functions

end

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

fun end(): MotionState

flipped

Returns a flipped (negated) version of the segment.

fun flipped(): MotionSegment

get

Returns the MotionState at time t.

operator fun get(t: Double): MotionState

reversed

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.

fun reversed(): MotionSegment

toString

fun toString(): String