Record Class SwervePointKinematics

java.lang.Object
java.lang.Record
xbot.common.subsystems.drive.SwervePointKinematics

public record SwervePointKinematics(LinearAcceleration acceleration, LinearVelocity initialVelocity, LinearVelocity goalVelocity, LinearVelocity maxVelocity) extends Record
  • Constructor Details

    • SwervePointKinematics

      public SwervePointKinematics(double acceleration, double initialVelocity, double goalVelocity, double maxVelocity)
      Creates a set of Kinematics values with METERS
      Parameters:
      acceleration - in meters/second^2
      initialVelocity - in meters/second; velocity at start
      goalVelocity - in meters/second; velocity we WANT to end at, in range of [-maxVelocity, maxVelocity]
      maxVelocity - in meters/second; max speed constraint
    • SwervePointKinematics

      public SwervePointKinematics(LinearAcceleration acceleration, LinearVelocity initialVelocity, LinearVelocity goalVelocity, LinearVelocity maxVelocity)
      Creates an instance of a SwervePointKinematics record class.
      Parameters:
      acceleration - the value for the acceleration record component
      initialVelocity - the value for the initialVelocity record component
      goalVelocity - the value for the goalVelocity record component
      maxVelocity - the value for the maxVelocity record component
  • Method Details

    • kinematicsWithNewInitialVelocity

      public SwervePointKinematics kinematicsWithNewInitialVelocity(LinearVelocity newInitialVelocity)
      Parameters:
      newInitialVelocity - for the set of kinematics
      Returns:
      a new set of kinematics values!
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • acceleration

      public LinearAcceleration acceleration()
      Returns the value of the acceleration record component.
      Returns:
      the value of the acceleration record component
    • initialVelocity

      public LinearVelocity initialVelocity()
      Returns the value of the initialVelocity record component.
      Returns:
      the value of the initialVelocity record component
    • goalVelocity

      public LinearVelocity goalVelocity()
      Returns the value of the goalVelocity record component.
      Returns:
      the value of the goalVelocity record component
    • maxVelocity

      public LinearVelocity maxVelocity()
      Returns the value of the maxVelocity record component.
      Returns:
      the value of the maxVelocity record component