Package frc.lib
Record Class IMUState
java.lang.Object
java.lang.Record
frc.lib.IMUState
public record IMUState(double timestampSec, double rollRad, double pitchRad, double yawRad, double rollVelRadPerSec, double pitchVelRadPerSec, double yawVelRadPerSec)
extends Record
Represents a 6-DOF high-frequency snapshot for vision correction.
-
Constructor Summary
ConstructorsConstructorDescriptionIMUState(double timestampSec, double rollRad, double pitchRad, double yawRad, double rollVelRadPerSec, double pitchVelRadPerSec, double yawVelRadPerSec) Creates an instance of aIMUStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublepitchRad()Returns the value of thepitchRadrecord component.doubleReturns the value of thepitchVelRadPerSecrecord component.doublerollRad()Returns the value of therollRadrecord component.doubleReturns the value of therollVelRadPerSecrecord component.doubleReturns the value of thetimestampSecrecord component.final StringtoString()Returns a string representation of this record class.doubleyawRad()Returns the value of theyawRadrecord component.doubleReturns the value of theyawVelRadPerSecrecord component.
-
Constructor Details
-
IMUState
public IMUState(double timestampSec, double rollRad, double pitchRad, double yawRad, double rollVelRadPerSec, double pitchVelRadPerSec, double yawVelRadPerSec) Creates an instance of aIMUStaterecord class.- Parameters:
timestampSec- the value for thetimestampSecrecord componentrollRad- the value for therollRadrecord componentpitchRad- the value for thepitchRadrecord componentyawRad- the value for theyawRadrecord componentrollVelRadPerSec- the value for therollVelRadPerSecrecord componentpitchVelRadPerSec- the value for thepitchVelRadPerSecrecord componentyawVelRadPerSec- the value for theyawVelRadPerSecrecord component
-
-
Method Details
-
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. All components in this record class are compared with '=='. -
timestampSec
public double timestampSec()Returns the value of thetimestampSecrecord component.- Returns:
- the value of the
timestampSecrecord component
-
rollRad
public double rollRad()Returns the value of therollRadrecord component.- Returns:
- the value of the
rollRadrecord component
-
pitchRad
public double pitchRad()Returns the value of thepitchRadrecord component.- Returns:
- the value of the
pitchRadrecord component
-
yawRad
public double yawRad()Returns the value of theyawRadrecord component.- Returns:
- the value of the
yawRadrecord component
-
rollVelRadPerSec
public double rollVelRadPerSec()Returns the value of therollVelRadPerSecrecord component.- Returns:
- the value of the
rollVelRadPerSecrecord component
-
pitchVelRadPerSec
public double pitchVelRadPerSec()Returns the value of thepitchVelRadPerSecrecord component.- Returns:
- the value of the
pitchVelRadPerSecrecord component
-
yawVelRadPerSec
public double yawVelRadPerSec()Returns the value of theyawVelRadPerSecrecord component.- Returns:
- the value of the
yawVelRadPerSecrecord component
-