TrajectoryCommandBuilder

public final class TrajectoryCommandBuilder

Functions

Link copied to clipboard

Adds the provided acceleration constraints for the following path segments.

Link copied to clipboard
public final TrajectoryCommandBuilder addAngularConstraints(Angle angVel, Angle angAccel, Angle angJerk)

Adds the provided angular constraints for the following turn segments.

Link copied to clipboard

Adds the provided constraints to the following path and turn segments.

Adds the provided constraints for the following path segments.

Link copied to clipboard

Adds a marker at the current position of the trajectory.

Adds a marker to the trajectory at displacement.

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

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

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

Link copied to clipboard

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

Link copied to clipboard

Adds a marker to the trajectory at time.

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

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

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

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

Link copied to clipboard

Adds the provided velocity constraints for the following path segments.

Link copied to clipboard
public final TrajectoryCommandBuilder back(Double distance)
public final TrajectoryCommandBuilder back(Double distance, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder back(Double distance, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line straight backward.

Link copied to clipboard
public final Trajectory build()

Constructs the Trajectory instance.

Link copied to clipboard
public final TrajectoryCommandBuilder forward(Double distance)
public final TrajectoryCommandBuilder forward(Double distance, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder forward(Double distance, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line straight forward.

Link copied to clipboard
public final TrajectoryCommandBuilder lineTo(Vector2d endPosition)
public final TrajectoryCommandBuilder lineTo(Vector2d endPosition, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder lineTo(Vector2d endPosition, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line segment with tangent heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder lineToConstantHeading(Vector2d endPosition, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line segment with constant heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder lineToLinearHeading(Pose2d endPose, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line segment with linear heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder lineToSplineHeading(Pose2d endPose, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a line segment with spline heading interpolation.

Link copied to clipboard

Resets all constraints to the default constructor-provided values.

Link copied to clipboard

Resets the angular constraints to the default constructor-provided values.

Link copied to clipboard

Resets the path constraints to the default constructor-provided values.

Link copied to clipboard

Sets the acceleration constraints for the following path segments.

Link copied to clipboard
public final TrajectoryCommandBuilder setAngularConstraints(Angle angVelOverride, Angle angAccelOverride)
public final TrajectoryCommandBuilder setAngularConstraints(Angle angVelOverride, Angle angAccelOverride, Angle angJerkOverride)

Sets the angular constraints for the following turn segments.

Link copied to clipboard

Sets the constraints for the following segments using the provided constraints. Sets both the path and angular constraints.

public final TrajectoryCommandBuilder setConstraints(TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Sets the constraints for the following path segments.

Link copied to clipboard

Sets the velocity constraints for the following path segments.

Link copied to clipboard
public final TrajectoryCommandBuilder splineTo(Vector2d endPosition, Angle endTangent)
public final TrajectoryCommandBuilder splineTo(Vector2d endPosition, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder splineTo(Vector2d endPosition, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a spline segment with tangent heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder splineToConstantHeading(Vector2d endPosition, Angle endTangent)
public final TrajectoryCommandBuilder splineToConstantHeading(Vector2d endPosition, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder splineToConstantHeading(Vector2d endPosition, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a spline segment with constant heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder splineToLinearHeading(Pose2d endPose, Angle endTangent)
public final TrajectoryCommandBuilder splineToLinearHeading(Pose2d endPose, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder splineToLinearHeading(Pose2d endPose, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a spline segment with linear heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder splineToSplineHeading(Pose2d endPose, Angle endTangent)
public final TrajectoryCommandBuilder splineToSplineHeading(Pose2d endPose, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder splineToSplineHeading(Pose2d endPose, Angle endTangent, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a spline segment with spline heading interpolation.

Link copied to clipboard
public final TrajectoryCommandBuilder strafeLeft(Double distance)
public final TrajectoryCommandBuilder strafeLeft(Double distance, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder strafeLeft(Double distance, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

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

Link copied to clipboard
public final TrajectoryCommandBuilder strafeRight(Double distance, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder strafeRight(Double distance, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

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

Link copied to clipboard
public final TrajectoryCommandBuilder strafeTo(Vector2d endPosition)
public final TrajectoryCommandBuilder strafeTo(Vector2d endPosition, TrajectoryVelocityConstraint velConstraintOverride)
public final TrajectoryCommandBuilder strafeTo(Vector2d endPosition, TrajectoryVelocityConstraint velConstraintOverride, TrajectoryAccelerationConstraint accelConstraintOverride)

Adds a strafe path segment.

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

Adds a turn segment that turns the specified angle.

public final TrajectoryCommandBuilder turn(Angle angle, Angle angVelOverride)
public final TrajectoryCommandBuilder turn(Angle angle, Angle angVelOverride, Angle angAccelOverride)
public final TrajectoryCommandBuilder turn(Angle angle, Angle angVelOverride, Angle angAccelOverride, Angle angJerkOverride)

Adds a turn segment that turns angle degrees.

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

Adds a wait segment that waits seconds.