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
ConstructorDescriptionGoalEndState
(double velocityMPS, Rotation2d rotation) Creates an instance of aGoalEndState
record class.GoalEndState
(edu.wpi.first.units.measure.LinearVelocity velocity, Rotation2d rotation) Describes the goal end state of the robot when finishing a path -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates 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 int
hashCode()
Returns a hash code value for this object.rotation()
Returns the value of therotation
record component.final String
toString()
Returns a string representation of this record class.edu.wpi.first.units.measure.LinearVelocity
velocity()
Get the end linear velocitydouble
Returns the value of thevelocityMPS
record 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 aGoalEndState
record class.- Parameters:
velocityMPS
- the value for thevelocityMPS
record componentrotation
- the value for therotation
record 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
public edu.wpi.first.units.measure.LinearVelocity 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 thevelocityMPS
record component.- Returns:
- the value of the
velocityMPS
record component
-
rotation
Returns the value of therotation
record component.- Returns:
- the value of the
rotation
record component
-