Record Class OdometryGuard.Sample

java.lang.Object
java.lang.Record
frc.spectrumLib.localization.OdometryGuard.Sample
Record Components:
time - seconds
primaryYaw - primary gyro yaw, radians
primaryOk - primary gyro connected and not a dead read
backupYaw - backup gyro yaw, radians
backupOk - backup gyro present and reading
distances - module drive distances, metres
angles - module steer angles, radians
moduleOk - per module: connected and not a dead read
Enclosing class:
OdometryGuard

public static record OdometryGuard.Sample(double time, double primaryYaw, boolean primaryOk, double backupYaw, boolean backupOk, double[] distances, double[] angles, boolean[] moduleOk) extends Record
One odometry sample.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Sample(double time, double primaryYaw, boolean primaryOk, double backupYaw, boolean backupOk, double[] distances, double[] angles, boolean[] moduleOk)
    Creates an instance of a Sample record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Returns the value of the angles record component.
    boolean
    Returns the value of the backupOk record component.
    double
    Returns the value of the backupYaw record component.
    double[]
    Returns the value of the distances record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean[]
    Returns the value of the moduleOk record component.
    boolean
    Returns the value of the primaryOk record component.
    double
    Returns the value of the primaryYaw record component.
    double
    Returns the value of the time record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Sample

      public Sample(double time, double primaryYaw, boolean primaryOk, double backupYaw, boolean backupOk, double[] distances, double[] angles, boolean[] moduleOk)
      Creates an instance of a Sample record class.
      Parameters:
      time - the value for the time record component
      primaryYaw - the value for the primaryYaw record component
      primaryOk - the value for the primaryOk record component
      backupYaw - the value for the backupYaw record component
      backupOk - the value for the backupOk record component
      distances - the value for the distances record component
      angles - the value for the angles record component
      moduleOk - the value for the moduleOk record component
  • Method Details

    • 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 the compare method from their corresponding wrapper classes.
      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.
    • time

      public double time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • primaryYaw

      public double primaryYaw()
      Returns the value of the primaryYaw record component.
      Returns:
      the value of the primaryYaw record component
    • primaryOk

      public boolean primaryOk()
      Returns the value of the primaryOk record component.
      Returns:
      the value of the primaryOk record component
    • backupYaw

      public double backupYaw()
      Returns the value of the backupYaw record component.
      Returns:
      the value of the backupYaw record component
    • backupOk

      public boolean backupOk()
      Returns the value of the backupOk record component.
      Returns:
      the value of the backupOk record component
    • distances

      public double[] distances()
      Returns the value of the distances record component.
      Returns:
      the value of the distances record component
    • angles

      public double[] angles()
      Returns the value of the angles record component.
      Returns:
      the value of the angles record component
    • moduleOk

      public boolean[] moduleOk()
      Returns the value of the moduleOk record component.
      Returns:
      the value of the moduleOk record component