public class PathBuilder
Easy-to-use builder for creating class Path
instances.
class Path
@JvmOverloads public PathBuilder(@NotNull Pose2d startPose, double startTangent)
@JvmOverloads public PathBuilder(@NotNull Pose2d startPose)
public PathBuilder(@NotNull Pose2d startPose, boolean reversed)
public PathBuilder(@NotNull Path path, double s)
@NotNull public PathBuilder lineTo(@NotNull Vector2d endPosition)
Adds a line segment with tangent heading interpolation.
endPosition
- end position@NotNull public PathBuilder lineToConstantHeading(@NotNull Vector2d endPosition)
Adds a line segment with constant heading interpolation.
endPosition
- end position@NotNull public PathBuilder strafeTo(@NotNull Vector2d endPosition)
Adds a strafe segment (i.e., a line segment with constant heading interpolation).
endPosition
- end position@NotNull public PathBuilder lineToLinearHeading(@NotNull Pose2d endPose)
Adds a line segment with linear heading interpolation.
endPose
- end pose@NotNull public PathBuilder lineToSplineHeading(@NotNull Pose2d endPose)
Adds a line segment with spline heading interpolation.
endPose
- end pose@NotNull public PathBuilder forward(double distance)
Adds a line straight forward.
distance
- distance to travel forward@NotNull public PathBuilder back(double distance)
Adds a line straight backward.
distance
- distance to travel backward@NotNull public PathBuilder strafeLeft(double distance)
Adds a segment that strafes left in the robot reference frame.
distance
- distance to strafe left@NotNull public PathBuilder strafeRight(double distance)
Adds a segment that strafes right in the robot reference frame.
distance
- distance to strafe right@NotNull public PathBuilder splineTo(@NotNull Vector2d endPosition, double endTangent)
Adds a spline segment with tangent heading interpolation.
endPosition
- end positionendTangent
- end tangent@NotNull public PathBuilder splineToConstantHeading(@NotNull Vector2d endPosition, double endTangent)
Adds a spline segment with constant heading interpolation.
endPosition
- end positionendTangent
- end tangent@NotNull public PathBuilder splineToLinearHeading(@NotNull Pose2d endPose, double endTangent)
Adds a spline segment with linear heading interpolation.
endPose
- end poseendTangent
- end tangent@NotNull public PathBuilder splineToSplineHeading(@NotNull Pose2d endPose, double endTangent)
Adds a spline segment with spline heading interpolation.
endPose
- end poseendTangent
- end tangent@NotNull public Path build()
Constructs the class Path
instance.
class Path