class SimpleTrajectoryBuilder : BaseTrajectoryBuilder
Builder for trajectories with static constraints.
SimpleTrajectoryBuilder(startPose: Pose2d, driveConstraints: DriveConstraints, start: MotionState = MotionState(0.0, 0.0, 0.0))
Create a builder from a start pose and motion state. This is the recommended constructor for creating trajectories from rest. SimpleTrajectoryBuilder(trajectory: Trajectory, t: Double, driveConstraints: DriveConstraints)
Create a builder from an active trajectory. This is useful for interrupting a live trajectory and smoothly transitioning to a new one. |
fun buildTrajectory(path: Path, temporalMarkers: List<TemporalMarker>, spatialMarkers: List<SpatialMarker>): Trajectory
Build a trajectory from path. |
fun addMarker(time: Double, callback: () -> Unit): BaseTrajectoryBuilder
Adds a marker to the trajectory at time. fun addMarker(point: Vector2d, callback: () -> Unit): BaseTrajectoryBuilder
Adds a marker that will be triggered at the closest trajectory point to point. fun addMarker(callback: () -> Unit): BaseTrajectoryBuilder
Adds a marker at the current position of the trajectory. |
|
fun back(distance: Double): BaseTrajectoryBuilder
Adds a line straight backward. |
|
fun build(): Trajectory
Constructs the Trajectory instance. |
|
fun forward(distance: Double): BaseTrajectoryBuilder
Adds a line straight forward. |
|
fun lineTo(pos: Vector2d, interpolator: HeadingInterpolator = TangentInterpolator()): BaseTrajectoryBuilder
Adds a line path segment. |
|
fun reverse(): BaseTrajectoryBuilder
Reverse the direction of robot travel. |
|
fun setReversed(reversed: Boolean): BaseTrajectoryBuilder
Sets the robot travel direction. |
|
fun splineTo(pose: Pose2d, interpolator: HeadingInterpolator = TangentInterpolator()): BaseTrajectoryBuilder
Adds a spline segment. |
|
fun strafeLeft(distance: Double): BaseTrajectoryBuilder
Adds a segment that strafes left in the robot reference frame. |
|
fun strafeRight(distance: Double): BaseTrajectoryBuilder
Adds a segment that strafes right in the robot reference frame. |
|
fun strafeTo(pos: Vector2d): BaseTrajectoryBuilder
Adds a strafe path segment. |