TrajectorySequenceBuilder

RoadRunner trajectory sequence builder. See RoadRunner.

Since

1.0.0-pre

Parameters

<T>

The type of the subclass (used for derived builder patterns to return this)

Inheritors

Constructors

Link copied to clipboard
constructor(startPose: Pose2d, startTangent: Double, baseVelConstraint: TrajectoryVelocityConstraint, baseAccelConstraint: TrajectoryAccelerationConstraint, baseTurnConstraintMaxAngVel: Double, baseTurnConstraintMaxAngAccel: Double)
Create a new TrajectorySequenceBuilder
constructor(startPose: Pose2d, baseVelConstraint: TrajectoryVelocityConstraint, baseAccelConstraint: TrajectoryAccelerationConstraint, baseTurnConstraintMaxAngVel: Double, baseTurnConstraintMaxAngAccel: Double)
Create a new TrajectorySequenceBuilder

Properties

Link copied to clipboard
val baseAccelConstraint: TrajectoryAccelerationConstraint
Link copied to clipboard
val baseVelConstraint: TrajectoryVelocityConstraint

Functions

Link copied to clipboard
open fun addDisplacementMarker(callback: MarkerCallback): T
Add a displacement marker at the current displacement to run a callback at that displacement.
open fun addDisplacementMarker(displacementInches: DisplacementProducer, callback: MarkerCallback): T
open fun addDisplacementMarker(displacementInches: Double, callback: MarkerCallback): T
open fun addDisplacementMarker(displacement: DisplacementProducer, inUnit: Distance, callback: MarkerCallback): T
open fun addDisplacementMarker(scale: Double, offsetInches: Double, callback: MarkerCallback): T
open fun addDisplacementMarker(displacement: Double, inUnit: Distance, callback: MarkerCallback): T
open fun addDisplacementMarker(scale: Double, offset: Double, inUnit: Distance, callback: MarkerCallback): T
Add a displacement marker at a given displacement to run a callback at that displacement.
Link copied to clipboard
open fun addSpatialMarker(pointInches: Vector2d, callback: MarkerCallback): T
open fun addSpatialMarker(point: Vector2d, inUnit: Distance, callback: MarkerCallback): T
Add a spatial marker at the current position to run a callback at that position.
Link copied to clipboard
open fun addTemporalMarker(callback: MarkerCallback): T
Add a temporal marker at the current duration to run a callback at that time.
open fun addTemporalMarker(time: TimeProducer, callback: MarkerCallback): T
open fun addTemporalMarker(time: Double, callback: MarkerCallback): T
open fun addTemporalMarker(time: Measure<Time>, callback: MarkerCallback): T
open fun addTemporalMarker(time: TimeProducer, timeUnit: Time, callback: MarkerCallback): T
open fun addTemporalMarker(scale: Double, offset: Double, callback: MarkerCallback): T
open fun addTemporalMarker(scale: Double, offset: Measure<Time>, callback: MarkerCallback): T
open fun addTemporalMarker(time: Double, unit: Time, callback: MarkerCallback): T
Add a temporal marker at a given time to run a callback at that time.
Link copied to clipboard
open fun addTrajectory(trajectory: Trajectory): T
Add a trajectory to the sequence.
Link copied to clipboard
open fun back(inches: Double): T
open fun back(distance: Double, inUnit: Distance): T
Move backward a given distance.
open fun back(inches: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun back(distance: Double, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move backward a given distance with custom velocity and acceleration constraints.
Link copied to clipboard
Create a TrajectorySequence from the current builder state.
Link copied to clipboard
open fun constraintIn(inUnit: Velocity<Distance>, constraint: TrajectoryVelocityConstraint): TrajectoryVelocityConstraint
open fun constraintIn(inUnit: Velocity<Velocity<Distance>>, constraint: TrajectoryAccelerationConstraint): TrajectoryAccelerationConstraint
Convert a constraint to a new unit.
Link copied to clipboard
open fun forward(inches: Double): T
open fun forward(distance: Double, inUnit: Distance): T
Move forward a given distance.
open fun forward(inches: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun forward(distance: Double, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move forward a given distance with custom velocity and acceleration constraints.
Link copied to clipboard
open fun lineTo(endPositionInches: Vector2d): T
open fun lineTo(endPosition: Vector2d, inUnit: Distance): T
Move in a straight line to a given position.
open fun lineTo(endPositionInches: Vector2d, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun lineTo(endPositionInches: Vector2d, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move in a straight line to a given position with custom velocity and acceleration constraints.
Link copied to clipboard
open fun lineToConstantHeading(endPositionInches: Vector2d): T
open fun lineToConstantHeading(endPosition: Vector2d, inUnit: Distance): T
Move in a straight line to a given position with a constant heading.
open fun lineToConstantHeading(endPositionInches: Vector2d, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun lineToConstantHeading(endPosition: Vector2d, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move in a straight line to a given position with a constant heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun lineToLinearHeading(endPoseInchRad: Pose2d): T
open fun lineToLinearHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle): T
Move in a straight line to a given position with a linear heading.
open fun lineToLinearHeading(endPoseInchRad: Pose2d, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun lineToLinearHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move in a straight line to a given position with a linear heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun lineToSplineHeading(endPoseInchRad: Pose2d): T
open fun lineToSplineHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle): T
Move in a straight line to a given position with a spline heading.
open fun lineToSplineHeading(endPoseInchRad: Pose2d, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun lineToSplineHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move in a straight line to a given position with a spline heading and custom velocity and acceleration constraints.
Link copied to clipboard
Reset the acceleration constraint to the base acceleration constraint.
Link copied to clipboard
open fun resetAngAccel(): T
Reset the angular acceleration to the base angular acceleration.
Link copied to clipboard
open fun resetAngVel(): T
Reset the angular velocity to the base angular velocity.
Link copied to clipboard
open fun resetConstraints(): T
Reset the velocity and acceleration constraints to the base constraints.
Link copied to clipboard
Reset the turn constraints to the base turn constraints.
Link copied to clipboard
open fun resetVelConstraint(): T
Reset the velocity constraint to the base velocity constraint.
Link copied to clipboard
open fun setAccelConstraint(accelConstraint: TrajectoryAccelerationConstraint): T
Set the acceleration constraint for the next builder instructions.
Link copied to clipboard
open fun setAngAccel(maxAngAccel: Double): T
open fun setAngAccel(maxAngAccel: Double, accelUnit: Velocity<Velocity<Angle>>): T
Set the maximum angular acceleration for the next builder instructions.
Link copied to clipboard
open fun setAngVel(maxAngVel: Double): T
open fun setAngVel(maxAngVel: Double, velUnit: Velocity<Angle>): T
Set the maximum angular velocity for the next builder instructions.
Link copied to clipboard
open fun setConstraints(velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Set the velocity and acceleration constraints for the next builder instructions.
Link copied to clipboard
open fun setReversed(reversed: Boolean): T
Reverse or unreverse the tangent of the next path.
Link copied to clipboard
open fun setTangent(tangent: Double): T
open fun setTangent(tangent: Double, angleUnit: Angle): T
Set the tangent of the next path.
Link copied to clipboard
open fun setTurnConstraint(maxAngVel: Double, maxAngAccel: Double): T
open fun setTurnConstraint(maxAngVel: Double, velUnit: Velocity<Angle>, maxAngAccel: Double, accelUnit: Velocity<Velocity<Angle>>): T
Set the turn constraints for the next builder instructions.
Link copied to clipboard
open fun setVelConstraint(velConstraint: TrajectoryVelocityConstraint): T
Set the velocity constraint for the next builder instructions.
Link copied to clipboard
open fun splineTo(endPositionInches: Vector2d, endHeadingRad: Double): T
open fun splineTo(endPosition: Vector2d, inUnit: Distance, endHeading: Double, angleUnit: Angle): T
Spline to a given position with a given heading.
open fun splineTo(endPositionInches: Vector2d, endHeadingRad: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun splineTo(endPosition: Vector2d, inUnit: Distance, endHeading: Double, angleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Spline to a given position with a given heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun splineToConstantHeading(endPositionInches: Vector2d, endHeadingRad: Double): T
open fun splineToConstantHeading(endPosition: Vector2d, inUnit: Distance, endHeading: Double, angleUnit: Angle): T
Spline to a given position with a constant heading.
open fun splineToConstantHeading(endPositionInches: Vector2d, endHeadingRad: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun splineToConstantHeading(endPosition: Vector2d, inUnit: Distance, endHeading: Double, angleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Spline to a given position with a constant heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun splineToLinearHeading(endPoseInchRad: Pose2d, endHeadingRad: Double): T
open fun splineToLinearHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, endHeading: Double, endAngleUnit: Angle): T
Spline to a given position with a linear heading.
open fun splineToLinearHeading(endPoseInchRad: Pose2d, endHeadingRad: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun splineToLinearHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, endHeading: Double, endAngleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Spline to a given position with a linear heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun splineToSplineHeading(endPoseInchRad: Pose2d, endHeadingRad: Double): T
open fun splineToSplineHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, endHeading: Double, endAngleUnit: Angle): T
Spline to a given position with a spline heading.
open fun splineToSplineHeading(endPoseInchRad: Pose2d, endHeadingRad: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun splineToSplineHeading(endPose: Pose2d, distanceUnit: Distance, angleUnit: Angle, endHeading: Double, endAngleUnit: Angle, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Spline to a given position with a spline heading and custom velocity and acceleration constraints.
Link copied to clipboard
open fun strafeLeft(inches: Double): T
open fun strafeLeft(distance: Double, inUnit: Distance): T
Strafe left a given distance.
open fun strafeLeft(inches: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun strafeLeft(distance: Double, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Strafe left a given distance with custom velocity and acceleration constraints.
Link copied to clipboard
open fun strafeRight(inches: Double): T
open fun strafeRight(distance: Double, inUnit: Distance): T
Strafe right a given distance.
open fun strafeRight(inches: Double, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun strafeRight(distance: Double, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Strafe right a given distance with custom velocity and acceleration constraints.
Link copied to clipboard
open fun strafeTo(endPositionInches: Vector2d): T
open fun strafeTo(endPosition: Vector2d, inUnit: Distance): T
Move in a strafe straight line to a given position.
open fun strafeTo(endPositionInches: Vector2d, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
open fun strafeTo(endPosition: Vector2d, inUnit: Distance, velConstraint: TrajectoryVelocityConstraint, accelConstraint: TrajectoryAccelerationConstraint): T
Move in a strafe straight line to a given position with custom velocity and acceleration constraints.
Link copied to clipboard
open fun turn(radians: Double): T
open fun turn(angle: Double, angleUnit: Angle): T
Turn to a given angle.
open fun turn(angle: Double, maxAngVel: Double, maxAngAccel: Double): T
open fun turn(angle: Double, angleUnit: Angle, maxAngVel: Double, velUnit: Velocity<Angle>, maxAngAccel: Double, accelUnit: Velocity<Velocity<Angle>>): T
Turn to a given angle with custom maximum angular velocity and acceleration.
Link copied to clipboard
open fun UNSTABLE_addDisplacementMarkerOffset(offsetInches: Double, callback: MarkerCallback): T
open fun UNSTABLE_addDisplacementMarkerOffset(offset: Double, inUnit: Distance, callback: MarkerCallback): T
Add a displacement marker at the current displacement plus an offset to run a callback at that displacement.
Link copied to clipboard
open fun UNSTABLE_addTemporalMarkerOffset(offset: Double, callback: MarkerCallback): T
open fun UNSTABLE_addTemporalMarkerOffset(offset: Measure<Time>, callback: MarkerCallback): T
open fun UNSTABLE_addTemporalMarkerOffset(offset: Double, unit: Time, callback: MarkerCallback): T
Add a temporal marker at the current duration plus an offset to run a callback at that time.
Link copied to clipboard
open fun waitFor(time: Measure<Time>): T
Wait for a given amount of time.
open fun waitFor(time: Double, unit: Time): T
Wait for a given magnitude and unit of time.
Link copied to clipboard
open fun waitSeconds(seconds: Double): T
Wait for a given number of seconds.