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

public record GoalEndState(double velocityMPS, Rotation2d rotation) extends Record
Describes the goal end state of the robot when finishing a path
  • Constructor Summary

    Constructors
    Constructor
    Description
    GoalEndState(double velocityMPS, Rotation2d rotation)
    Creates an instance of a GoalEndState 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 Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Flip the goal end state for the other side of the field, maintaining a blue alliance origin
    final int
    Returns a hash code value for this object.
    Returns the value of the rotation record component.
    final String
    Returns a string representation of this record class.
    edu.wpi.first.units.measure.LinearVelocity
    Get the end linear velocity
    double
    Returns the value of the velocityMPS record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GoalEndState

      public GoalEndState(edu.wpi.first.units.measure.LinearVelocity velocity, Rotation2d rotation)
      Describes the goal end state of the robot when finishing a path
      Parameters:
      velocity - The goal end velocity
      rotation - The goal rotation
    • GoalEndState

      public GoalEndState(double velocityMPS, Rotation2d rotation)
      Creates an instance of a GoalEndState record class.
      Parameters:
      velocityMPS - the value for the velocityMPS record component
      rotation - the value for the rotation record component
  • Method Details

    • flip

      public GoalEndState 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • velocityMPS

      public double velocityMPS()
      Returns the value of the velocityMPS record component.
      Returns:
      the value of the velocityMPS record component
    • rotation

      public Rotation2d rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component