core / com.acmerobotics.roadrunner.trajectory / PathTrajectorySegment

PathTrajectorySegment

class PathTrajectorySegment : TrajectorySegment

Trajectory segment backed by a list of Path objects.

Parameters

paths - paths

profile - motion profile

Constructors

<init>

PathTrajectorySegment(paths: List<Path> = emptyList(), trajectoryConstraintsList: List<TrajectoryConstraints> = emptyList(), start: MotionState = MotionState(0.0, 0.0, 0.0), goal: MotionState = MotionState(paths.sumByDouble { it.length() }, 0.0, 0.0), resolution: Double = 0.25)
PathTrajectorySegment(path: Path, trajectoryConstraints: TrajectoryConstraints, start: MotionState = MotionState(0.0, 0.0, 0.0), goal: MotionState = MotionState(path.length(), 0.0, 0.0), resolution: Double = 0.25)
PathTrajectorySegment(paths: List<Path> = emptyList(), constraints: DriveConstraints, start: MotionState = MotionState(0.0, 0.0, 0.0, 0.0), goal: MotionState = MotionState(paths.sumByDouble { it.length() }, 0.0, 0.0, 0.0))
PathTrajectorySegment(path: Path, constraints: DriveConstraints, start: MotionState = MotionState(0.0, 0.0, 0.0, 0.0), goal: MotionState = MotionState(path.length(), 0.0, 0.0, 0.0))PathTrajectorySegment(paths: List<Path>, profile: MotionProfile)

Trajectory segment backed by a list of Path objects.

Properties

paths

val paths: List<Path>

paths

profile

val profile: MotionProfile

motion profile

Functions

acceleration

fun acceleration(time: Double): Pose2d

Returns the pose acceleration at the given time.

duration

fun duration(): Double

Returns the duration of the segment.

get

operator fun get(time: Double): Pose2d

Returns the pose at the given time.

velocity

fun velocity(time: Double): Pose2d

Returns the pose velocity at the given time.