Package com.pathplanner.lib.path
Record Class IdealStartingState
java.lang.Object
java.lang.Record
com.pathplanner.lib.path.IdealStartingState
- Record Components:
velocityMPS- The ideal starting velocity (M/S)rotation- The ideal starting rotation
Describes the ideal starting state of the robot when starting a path
-
Constructor Summary
ConstructorsConstructorDescriptionIdealStartingState(double velocityMPS, Rotation2d rotation) Creates an instance of aIdealStartingStaterecord class.IdealStartingState(LinearVelocity velocity, Rotation2d rotation) Describes the ideal starting state of the robot when starting a path -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.flip()Flip the ideal starting 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 starting linear velocitydoubleReturns the value of thevelocityMPSrecord component.
-
Constructor Details
-
IdealStartingState
Describes the ideal starting state of the robot when starting a path- Parameters:
velocity- The ideal starting velocityrotation- The ideal starting rotation
-
IdealStartingState
Creates an instance of aIdealStartingStaterecord class.- Parameters:
velocityMPS- the value for thevelocityMPSrecord componentrotation- the value for therotationrecord component
-
-
Method Details
-
flip
Flip the ideal starting state for the other side of the field, maintaining a blue alliance origin- Returns:
- The flipped starting state
-
velocity
Get the starting linear velocity- Returns:
- Starting 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
-