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 finishing a path
-
Constructor Summary
ConstructorDescriptionIdealStartingState
(double velocityMPS, Rotation2d rotation) Creates an instance of aIdealStartingState
record class.IdealStartingState
(edu.wpi.first.units.measure.LinearVelocity velocity, Rotation2d rotation) Describes the ideal starting 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 ideal starting 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 starting linear velocitydouble
Returns the value of thevelocityMPS
record component.
-
Constructor Details
-
IdealStartingState
Describes the ideal starting state of the robot when finishing a path- Parameters:
velocity
- The ideal starting velocityrotation
- The ideal starting rotation
-
IdealStartingState
Creates an instance of aIdealStartingState
record class.- Parameters:
velocityMPS
- the value for thevelocityMPS
record componentrotation
- the value for therotation
record 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
public edu.wpi.first.units.measure.LinearVelocity 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 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
-