PathBuilder

class PathBuilder(startPose: Pose2d, startDeriv: Pose2d, startSecondDeriv: Pose2d)

Easy-to-use builder for creating Path instances.

Parameters

startPose

start pose

startDeriv

start derivative

startSecondDeriv

start second derivative

See also

Constructors

Link copied to clipboard
constructor(startPose: Pose2d, startTangent: Angle = startPose.heading)
constructor(startPose: Pose2d, reversed: Boolean)
constructor(path: Path, s: Double)
constructor(startPose: Pose2d, startDeriv: Pose2d, startSecondDeriv: Pose2d)

Functions

Link copied to clipboard
fun addLine(endPosition: Vector2d, headingInterpolation: HeadingInterpolation = TangentHeading): PathBuilder

Adds a line segment with the specified heading interpolation.

Link copied to clipboard
fun addSpline(endPosition: Vector2d, endTangent: Angle, startTangentMag: Double = -1.0, endTangentMag: Double = -1.0, headingInterpolation: HeadingInterpolation = TangentHeading): PathBuilder

Adds a spline segment with the specified heading interpolation.

Link copied to clipboard
fun back(distance: Double): PathBuilder

Adds a line straight backward.

Link copied to clipboard
fun build(): Path

Constructs the Path instance.

Link copied to clipboard
fun forward(distance: Double): PathBuilder

Adds a line straight forward.

Link copied to clipboard
fun lineTo(endPosition: Vector2d): PathBuilder

Adds a line segment with tangent heading interpolation.

Link copied to clipboard

Adds a line segment with constant heading interpolation.

Link copied to clipboard

Adds a line segment with linear heading interpolation.

Link copied to clipboard

Adds a line segment with spline heading interpolation.

Link copied to clipboard
fun preBuild(): Path

Constructs the Path instance without reparameterizing the curves.

Link copied to clipboard
fun splineTo(endPosition: Vector2d, endTangent: Angle): PathBuilder

Adds a spline segment with tangent heading interpolation.

Link copied to clipboard
fun splineToConstantHeading(endPosition: Vector2d, endTangent: Angle): PathBuilder

Adds a spline segment with constant heading interpolation.

Link copied to clipboard
fun splineToLinearHeading(endPose: Pose2d, endTangent: Angle): PathBuilder

Adds a spline segment with linear heading interpolation.

Link copied to clipboard
fun splineToSplineHeading(endPose: Pose2d, endTangent: Angle): PathBuilder

Adds a spline segment with spline heading interpolation.

Link copied to clipboard
fun strafeLeft(distance: Double): PathBuilder

Adds a segment that strafes left in the robot reference frame.

Link copied to clipboard

Adds a segment that strafes right in the robot reference frame.

Link copied to clipboard
fun strafeTo(endPosition: Vector2d): PathBuilder

Adds a strafe segment (i.e., a line segment with constant heading interpolation).