makeTrajectory

Builds a RoadRunner trajectory starting from the robot's last-known position at the time of this method being called. Users should be aware that improperly calling this method multiple times can create trajectories that start from the wrong spot, as the start pose used will be the one set during initialisation and *NOT* the endpoint of the last trajectory.

The start pose of this trajectory is captured implicitly from memory. For chaining or splicing trajectories, see fresh or using a RefCell as a parameter to addTask or build to keep track of the end position of the last trajectory. For runtime pose evaluation, use defer.

See the RoadRunner section in the wiki for more details, and ensure to review your trajectories on a Field dashboard.

Return

a TaskBuilder for trajectory creation


open fun makeTrajectory(@NonNull poseMap: PoseMap): TaskBuilder

Builds a RoadRunner trajectory starting from the robot's last-known position at the time of this method being called. Users should be aware that improperly calling this method multiple times can create trajectories that start from the wrong spot, as the start pose used will be the one set during initialisation and *NOT* the endpoint of the last trajectory.

The start pose of this trajectory is captured implicitly from memory. For chaining or splicing trajectories, see fresh or using a RefCell as a parameter to addTask or build to keep track of the end position of the last trajectory. For runtime pose evaluation, use defer.

See the RoadRunner section in the wiki for more details, and ensure to review your trajectories on a Field dashboard.

Return

a TaskBuilder for trajectory creation

Parameters

poseMap

the PoseMap to use for this builder, note that the implicit last-known position is used and automatically passed into the PoseMap now to later 'invert' it. Using this method assumes your PoseMap is self-invertible.For most mappings, this will result in the absolute last-known position being used as the starting pose, which is usually the case when you are trying to use the current position of the robot. If you wish the PoseMap to apply normally, consider using the other makeTrajectory methods and manually passing the last-known position from Storage.


open fun makeTrajectory(@NonNull startPose: Pose2d): TaskBuilder

Builds a RoadRunner trajectory from an explicit start pose. This method yields the best accuracy.

Use this for precise control over the trajectory's starting position.

For chaining or splicing trajectories, see fresh or using a RefCell to splice when addTask or build is called. For runtime pose evaluation, use defer. See the RoadRunner section in the wiki for more details.

Return

a TaskBuilder for trajectory creation

Parameters

startPose

the explicit start Pose2d for this trajectory


open fun makeTrajectory(@NonNull startPose: Pose2d, @NonNull poseMap: PoseMap): TaskBuilder

Builds a RoadRunner trajectory from an explicit start pose, mapped through a PoseMap.

For chaining or splicing trajectories, see fresh or using a RefCell to splice when addTask or build is called. For runtime pose evaluation, use defer. See the RoadRunner section in the wiki for more details.

Return

a TaskBuilder for trajectory creation

Parameters

startPose

the explicit start Pose2d for this trajectory

poseMap

the PoseMap to transform the start pose


open fun makeTrajectory(@NonNull startVec: Vector2d, @NonNull distUnit: Distance, ang: Double, @NonNull angUnit: Angle): TaskBuilder

Builds a RoadRunner trajectory from a vector and angle, with explicit units.

For chaining or splicing trajectories, see fresh or using a RefCell to splice when addTask or build is called. For runtime pose evaluation, use defer. See the RoadRunner section in the wiki for more details.

Return

a TaskBuilder for trajectory creation

Parameters

startVec

the start Vector2d of this trajectory

distUnit

the Distance unit

ang

the angle value

angUnit

the Angle unit


open fun makeTrajectory(@NonNull startVec: Vector2d, @NonNull distUnit: Distance, ang: Double, @NonNull angUnit: Angle, @NonNull poseMap: PoseMap): TaskBuilder

Builds a RoadRunner trajectory from a vector and angle, with explicit units and pose mapping.

For chaining or splicing trajectories, see fresh or using a RefCell to splice when addTask or build is called. For runtime pose evaluation, use defer. See the RoadRunner section in the wiki for more details.

Return

a TaskBuilder for trajectory creation

Parameters

startVec

the start Vector2d of this trajectory

distUnit

the Distance unit

ang

the angle value

angUnit

the Angle unit

poseMap

the PoseMap to transform the start pose