public class PathBuilder
Easy-to-use builder for creating class Path instances.
class Path| Constructor and Description |
|---|
PathBuilder(Pose2d startPose)
Easy-to-use builder for creating
class Path instances. |
| Modifier and Type | Method and Description |
|---|---|
PathBuilder |
back(double distance)
Adds a line straight backward.
|
Path |
build()
Constructs the
class Path instance. |
PathBuilder |
forward(double distance)
Adds a line straight forward.
|
PathBuilder |
lineTo(Vector2d pos,
HeadingInterpolator interpolator)
Adds a line path segment.
|
PathBuilder |
lineTo(Vector2d pos)
Adds a line path segment.
|
PathBuilder |
reverse()
Reverse the direction of robot travel.
|
PathBuilder |
setReversed(boolean reversed)
Sets the robot travel direction.
|
PathBuilder |
splineTo(Pose2d pose,
HeadingInterpolator interpolator)
Adds a spline segment.
|
PathBuilder |
splineTo(Pose2d pose)
Adds a spline segment.
|
PathBuilder |
strafeLeft(double distance)
Adds a segment that strafes left in the robot reference frame.
|
PathBuilder |
strafeRight(double distance)
Adds a segment that strafes right in the robot reference frame.
|
PathBuilder |
strafeTo(Vector2d pos)
Adds a strafe path segment.
|
public PathBuilder(@NotNull
Pose2d startPose)
Easy-to-use builder for creating class Path instances.
startPose - start poseclass Path@NotNull public PathBuilder reverse()
Reverse the direction of robot travel.
@NotNull public PathBuilder setReversed(boolean reversed)
Sets the robot travel direction.
@JvmOverloads @NotNull public PathBuilder lineTo(@NotNull Vector2d pos, @NotNull HeadingInterpolator interpolator)
Adds a line path segment.
pos - end positioninterpolator - heading interpolator@JvmOverloads @NotNull public PathBuilder lineTo(@NotNull Vector2d pos)
Adds a line path segment.
pos - end position@NotNull public PathBuilder strafeTo(@NotNull Vector2d pos)
Adds a strafe path segment.
pos - end position@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@JvmOverloads @NotNull public PathBuilder splineTo(@NotNull Pose2d pose, @NotNull HeadingInterpolator interpolator)
Adds a spline segment.
pose - end poseinterpolator - heading interpolator@JvmOverloads @NotNull public PathBuilder splineTo(@NotNull Pose2d pose)
Adds a spline segment.
pose - end pose@NotNull public Path build()
Constructs the class Path instance.
class Path