Package com.pathplanner.lib.path
Record Class GoalEndState
java.lang.Object
java.lang.Record
com.pathplanner.lib.path.GoalEndState
- Record Components:
velocityMPS- The goal end velocity (M/S)rotation- The goal rotation
Describes the goal end state of the robot when finishing a path
-
Constructor Summary
ConstructorsConstructorDescriptionGoalEndState(double velocityMPS, Rotation2d rotation) Creates an instance of aGoalEndStaterecord class.GoalEndState(LinearVelocity velocity, Rotation2d rotation) Describes the goal end state of the robot when finishing a path -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.flip()Flip the goal end state for the other side of the field, maintaining a blue alliance originfinal inthashCode()Returns a hash code value for this object.rotation()Returns the value of therotationrecord component.final StringtoString()Returns a string representation of this record class.velocity()Get the end linear velocitydoubleReturns the value of thevelocityMPSrecord component.
-
Constructor Details
-
GoalEndState
Describes the goal end state of the robot when finishing a path- Parameters:
velocity- The goal end velocityrotation- The goal rotation
-
GoalEndState
Creates an instance of aGoalEndStaterecord class.- Parameters:
velocityMPS- the value for thevelocityMPSrecord componentrotation- the value for therotationrecord component
-
-
Method Details
-
flip
Flip the goal end state for the other side of the field, maintaining a blue alliance origin- Returns:
- The flipped end state
-
velocity
Get the end linear velocity- Returns:
- End linear velocity
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
velocityMPS
public double velocityMPS()Returns the value of thevelocityMPSrecord component.- Returns:
- the value of the
velocityMPSrecord component
-
rotation
Returns the value of therotationrecord component.- Returns:
- the value of the
rotationrecord component
-