public class PathBuilder
Easy-to-use builder for creating class Path
instances.
class Path
Constructor and Description |
---|
PathBuilder(Pose2d startPose) |
PathBuilder(Path path,
double s) |
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 end,
HeadingInterpolator interpolator)
Adds a line path segment.
|
PathBuilder |
lineTo(Vector2d end)
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 end,
HeadingInterpolator interpolator)
Adds a spline segment.
|
PathBuilder |
splineTo(Pose2d end)
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 end)
Adds a strafe path segment.
|
public PathBuilder(@NotNull Pose2d startPose)
public PathBuilder(@NotNull Path path, double s)
@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 end, @NotNull HeadingInterpolator interpolator)
Adds a line path segment.
end
- end positioninterpolator
- heading interpolator@JvmOverloads @NotNull public PathBuilder lineTo(@NotNull Vector2d end)
Adds a line path segment.
end
- end position@NotNull public PathBuilder strafeTo(@NotNull Vector2d end)
Adds a strafe path segment.
end
- 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 end, @NotNull HeadingInterpolator interpolator)
Adds a spline segment.
end
- end endinterpolator
- heading interpolator@JvmOverloads @NotNull public PathBuilder splineTo(@NotNull Pose2d end)
Adds a spline segment.
end
- end end@NotNull public Path build()
Constructs the class Path
instance.
class Path