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
ConstructorDescriptionWaypoint
(Translation2d prevControl, Translation2d anchor, Translation2d nextControl) Creates an instance of aWaypoint
record class. -
Method Summary
Modifier and TypeMethodDescriptionanchor()
Returns the value of theanchor
record component.final boolean
Indicates 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 int
hashCode()
Returns a hash code value for this object.Returns the value of thenextControl
record component.Returns the value of theprevControl
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Waypoint
Creates an instance of aWaypoint
record class.- Parameters:
prevControl
- the value for theprevControl
record componentanchor
- the value for theanchor
record componentnextControl
- the value for thenextControl
record 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 theprevControl
record component.- Returns:
- the value of the
prevControl
record component
-
anchor
Returns the value of theanchor
record component.- Returns:
- the value of the
anchor
record component
-
nextControl
Returns the value of thenextControl
record component.- Returns:
- the value of the
nextControl
record component
-