TrajectoryCommandBuilder

Constructors

Link copied to clipboard
constructor(drive: DriveTrajectoryFollower, startPose: Pose2d, startTangent: Angle)
constructor(drive: DriveTrajectoryFollower, startPose: Pose2d, reversed: Boolean)
constructor(drive: DriveTrajectoryFollower)

Functions

Link copied to clipboard

Adds the provided acceleration constraints for the following path segments.

Link copied to clipboard
fun addAngularConstraints(angVel: Angle, angAccel: Angle = Double.POSITIVE_INFINITY.rad, angJerk: Angle = Double.POSITIVE_INFINITY.rad): TrajectoryCommandBuilder

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.

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.

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

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
fun back(distance: Double, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a line straight backward.

Link copied to clipboard

Constructs the Trajectory instance.

Link copied to clipboard
fun forward(distance: Double, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a line straight forward.

Link copied to clipboard
fun lineTo(endPosition: Vector2d, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a line segment with tangent heading interpolation.

Link copied to clipboard
fun lineToConstantHeading(endPosition: Vector2d, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a line segment with constant heading interpolation.

Link copied to clipboard
fun lineToLinearHeading(endPose: Pose2d, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a line segment with linear heading interpolation.

Link copied to clipboard
fun lineToSplineHeading(endPose: Pose2d, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

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
fun setAngularConstraints(angVelOverride: Angle, angAccelOverride: Angle = builder.baseAngAccel, angJerkOverride: Angle = builder.baseAngJerk): TrajectoryCommandBuilder

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.

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
fun splineTo(endPosition: Vector2d, endTangent: Angle): TrajectoryCommandBuilder
fun splineTo(endPosition: Vector2d, endTangent: Angle, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a spline segment with tangent heading interpolation.

Link copied to clipboard
fun splineToConstantHeading(endPosition: Vector2d, endTangent: Angle, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a spline segment with constant heading interpolation.

Link copied to clipboard
fun splineToLinearHeading(endPose: Pose2d, endTangent: Angle, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a spline segment with linear heading interpolation.

Link copied to clipboard
fun splineToSplineHeading(endPose: Pose2d, endTangent: Angle, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a spline segment with spline heading interpolation.

Link copied to clipboard
fun strafeLeft(distance: Double, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

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

Link copied to clipboard
fun strafeRight(distance: Double, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

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

Link copied to clipboard
fun strafeTo(endPosition: Vector2d, velConstraintOverride: TrajectoryVelocityConstraint, accelConstraintOverride: TrajectoryAccelerationConstraint = builder.baseAccelConstraint): TrajectoryCommandBuilder

Adds a strafe path segment.

Link copied to clipboard

Adds a turn segment that turns the specified angle.

fun turn(angle: Angle, angVelOverride: Angle, angAccelOverride: Angle = builder.baseAngAccel, angJerkOverride: Angle = builder.baseAngJerk): TrajectoryCommandBuilder

Adds a turn segment that turns angle degrees.

Link copied to clipboard

Adds a wait segment that waits seconds.