core / com.acmerobotics.roadrunner.path / PathBuilder

PathBuilder

class PathBuilder (source)

Easy-to-use builder for creating Path instances.

Parameters

startPose - start pose

startTangent - start tangent

path - previous path

s - displacement in previous path

Constructors

<init>

PathBuilder(startPose: Pose2d, startTangent: Double = startPose.heading)
PathBuilder(startPose: Pose2d, reversed: Boolean)
PathBuilder(path: Path, s: Double)

Functions

back

Adds a line straight backward.

fun back(distance: Double): PathBuilder

build

Constructs the Path instance.

fun build(): Path

forward

Adds a line straight forward.

fun forward(distance: Double): PathBuilder

lineTo

Adds a line segment with tangent heading interpolation.

fun lineTo(endPosition: Vector2d): PathBuilder

lineToConstantHeading

Adds a line segment with constant heading interpolation.

fun lineToConstantHeading(endPosition: Vector2d): PathBuilder

lineToLinearHeading

Adds a line segment with linear heading interpolation.

fun lineToLinearHeading(endPose: Pose2d): PathBuilder

lineToSplineHeading

Adds a line segment with spline heading interpolation.

fun lineToSplineHeading(endPose: Pose2d): PathBuilder

splineTo

Adds a spline segment with tangent heading interpolation.

fun splineTo(endPosition: Vector2d, endTangent: Double): PathBuilder

splineToConstantHeading

Adds a spline segment with constant heading interpolation.

fun splineToConstantHeading(endPosition: Vector2d, endTangent: Double): PathBuilder

splineToLinearHeading

Adds a spline segment with linear heading interpolation.

fun splineToLinearHeading(endPose: Pose2d, endTangent: Double): PathBuilder

splineToSplineHeading

Adds a spline segment with spline heading interpolation.

fun splineToSplineHeading(endPose: Pose2d, endTangent: Double): PathBuilder

strafeLeft

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

fun strafeLeft(distance: Double): PathBuilder

strafeRight

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

fun strafeRight(distance: Double): PathBuilder

strafeTo

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

fun strafeTo(endPosition: Vector2d): PathBuilder