Package com.pathplanner.lib.path
Record Class Waypoint
java.lang.Object
java.lang.Record
com.pathplanner.lib.path.Waypoint
- Record Components:
prevControl- Previous control pointanchor- Anchor pointnextControl- Next control point
public record Waypoint(Translation2d prevControl, Translation2d anchor, Translation2d nextControl)
extends Record
Class used to describe a waypoint for a Bezier curve based path
-
Constructor Summary
ConstructorsConstructorDescriptionWaypoint(Translation2d prevControl, Translation2d anchor, Translation2d nextControl) Creates an instance of aWaypointrecord class. -
Method Summary
Modifier and TypeMethodDescriptionanchor()Returns the value of theanchorrecord component.final booleanIndicates whether some other object is "equal to" this one.flip()Flip this waypoint to the other side of the field, maintaining a blue alliance originfinal inthashCode()Returns a hash code value for this object.Returns the value of thenextControlrecord component.Returns the value of theprevControlrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Waypoint
Creates an instance of aWaypointrecord class.- Parameters:
prevControl- the value for theprevControlrecord componentanchor- the value for theanchorrecord componentnextControl- the value for thenextControlrecord component
-
-
Method Details
-
flip
Flip this waypoint to the other side of the field, maintaining a blue alliance origin- Returns:
- The flipped waypoint
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
prevControl
Returns the value of theprevControlrecord component.- Returns:
- the value of the
prevControlrecord component
-
anchor
Returns the value of theanchorrecord component.- Returns:
- the value of the
anchorrecord component
-
nextControl
Returns the value of thenextControlrecord component.- Returns:
- the value of the
nextControlrecord component
-