BaseTrajectoryBuilder

public abstract class BaseTrajectoryBuilder<T extends BaseTrajectoryBuilder<T>>

Easy-to-use builder for creating Trajectory instances.

Parameters

startPose

start pose

startDeriv

start derivative

startSecondDeriv

start second derivative

Inheritors

Constructors

Link copied to clipboard
protected BaseTrajectoryBuilder<T> BaseTrajectoryBuilder(Pose2d startPose, Pose2d startDeriv, Pose2d startSecondDeriv)

Functions

Link copied to clipboard
public final T addDisplacementMarker(MarkerCallback callback)

Adds a marker at the current position of the trajectory.

public final T addDisplacementMarker(Double displacement, MarkerCallback callback)

Adds a marker to the trajectory at displacement.

public final T addDisplacementMarker(Function1<Double, Double> displacement, MarkerCallback callback)

Adds a marker to the trajectory at displacement evaluated with path length.

public final T addDisplacementMarker(Double scale, Double offset, MarkerCallback callback)

Adds a marker to the trajectory at scale * path length + offset.

Link copied to clipboard
public final T addLine(Vector2d endPosition, HeadingInterpolation headingInterpolation)

Adds a line segment with the specified heading interpolation.

Link copied to clipboard
protected final Unit addPathSegment(Function0<Unit> add)
Link copied to clipboard
protected final Unit addSegment(TrajectorySegment segment)
Link copied to clipboard
public final T addSpatialMarker(Vector2d point, MarkerCallback callback)

Adds a marker that will be triggered at the closest trajectory point to point.

Link copied to clipboard
public final T addSpline(Vector2d endPosition, Angle endTangent)
public final T addSpline(Vector2d endPosition, Angle endTangent, Double startTangentMag)
public final T addSpline(Vector2d endPosition, Angle endTangent, Double startTangentMag, Double endTangentMag)
public final T addSpline(Vector2d endPosition, Angle endTangent, Double startTangentMag, Double endTangentMag, HeadingInterpolation headingInterpolation)

Adds a spline segment with the specified heading interpolation.

Link copied to clipboard
public final T addTemporalMarker(Double time, MarkerCallback callback)

Adds a marker to the trajectory at time.

public final T addTemporalMarker(Function1<Double, Double> time, MarkerCallback callback)

Adds a marker to the trajectory at time evaluated with the trajectory duration.

public final T addTemporalMarker(Double scale, Double offset, MarkerCallback callback)

Adds a marker to the trajectory at scale * trajectory duration + offset.

Link copied to clipboard
public final T back(Double distance)

Adds a line straight backward.

Link copied to clipboard
public final Trajectory build()

Constructs the Trajectory instance.

Link copied to clipboard
public final T forward(Double distance)

Adds a line straight forward.

Link copied to clipboard
public final T lineTo(Vector2d endPosition)

Adds a line segment with tangent heading interpolation.

Link copied to clipboard
public final T lineToConstantHeading(Vector2d endPosition)

Adds a line segment with constant heading interpolation.

Link copied to clipboard
public final T lineToLinearHeading(Pose2d endPose)

Adds a line segment with linear heading interpolation.

Link copied to clipboard
public final T lineToSplineHeading(Pose2d endPose)

Adds a line segment with spline heading interpolation.

Link copied to clipboard
protected abstract PathTrajectorySegment makePathSegment(Path path)
Link copied to clipboard
protected abstract TurnSegment makeTurnSegment(Pose2d pose, Angle angle)
Link copied to clipboard
protected final Unit pushPath()
Link copied to clipboard
public final T splineTo(Vector2d endPosition, Angle endTangent)

Adds a spline segment with tangent heading interpolation.

Link copied to clipboard
public final T splineToConstantHeading(Vector2d endPosition, Angle endTangent)

Adds a spline segment with constant heading interpolation.

Link copied to clipboard
public final T splineToLinearHeading(Pose2d endPose, Angle endTangent)

Adds a spline segment with linear heading interpolation.

Link copied to clipboard
public final T splineToSplineHeading(Pose2d endPose, Angle endTangent)

Adds a spline segment with spline heading interpolation.

Link copied to clipboard
public final T strafeLeft(Double distance)

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

Link copied to clipboard
public final T strafeRight(Double distance)

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

Link copied to clipboard
public final T strafeTo(Vector2d endPosition)

Adds a strafe path segment.

Link copied to clipboard
public final T turn(Angle angle)

Adds a turn segment that turns the specified angle.

Link copied to clipboard
public final T wait(Double seconds)

Adds a wait segment that waits seconds.