Package com.titaniumtigers4829.data.imu
Record Class IMUData
java.lang.Object
java.lang.Record
com.titaniumtigers4829.data.imu.IMUData
public record IMUData(double robotYaw, double roll, double pitch, double yaw, double gyroX, double gyroY, double gyroZ, double accelX, double accelY, double accelZ, IMUData.IMUMode imuMode)
extends Record
Encapsulates the state of an internal Limelight IMU. This includes gyro and accelerometer data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing different IMU usage modes for robot orientation or localization. -
Constructor Summary
ConstructorsConstructorDescriptionIMUData()Initializes an "empty" IMUData record with default valuesIMUData(double robotYaw, double roll, double pitch, double yaw, double gyroX, double gyroY, double gyroZ, double accelX, double accelY, double accelZ, IMUData.IMUMode imuMode) Creates an instance of aIMUDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccelX()Returns the value of theaccelXrecord component.doubleaccelY()Returns the value of theaccelYrecord component.doubleaccelZ()Returns the value of theaccelZrecord component.final booleanIndicates whether some other object is "equal to" this one.doublegyroX()Returns the value of thegyroXrecord component.doublegyroY()Returns the value of thegyroYrecord component.doublegyroZ()Returns the value of thegyroZrecord component.final inthashCode()Returns a hash code value for this object.imuMode()Returns the value of theimuModerecord component.doublepitch()Returns the value of thepitchrecord component.doublerobotYaw()Returns the value of therobotYawrecord component.doubleroll()Returns the value of therollrecord component.final StringtoString()Returns a string representation of this record class.doubleyaw()Returns the value of theyawrecord component.
-
Constructor Details
-
IMUData
public IMUData()Initializes an "empty" IMUData record with default values -
IMUData
public IMUData(double robotYaw, double roll, double pitch, double yaw, double gyroX, double gyroY, double gyroZ, double accelX, double accelY, double accelZ, IMUData.IMUMode imuMode) Creates an instance of aIMUDatarecord class.- Parameters:
robotYaw- the value for therobotYawrecord componentroll- the value for therollrecord componentpitch- the value for thepitchrecord componentyaw- the value for theyawrecord componentgyroX- the value for thegyroXrecord componentgyroY- the value for thegyroYrecord componentgyroZ- the value for thegyroZrecord componentaccelX- the value for theaccelXrecord componentaccelY- the value for theaccelYrecord componentaccelZ- the value for theaccelZrecord componentimuMode- the value for theimuModerecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
robotYaw
public double robotYaw()Returns the value of therobotYawrecord component.- Returns:
- the value of the
robotYawrecord component
-
roll
public double roll()Returns the value of therollrecord component.- Returns:
- the value of the
rollrecord component
-
pitch
public double pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
yaw
public double yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-
gyroX
public double gyroX()Returns the value of thegyroXrecord component.- Returns:
- the value of the
gyroXrecord component
-
gyroY
public double gyroY()Returns the value of thegyroYrecord component.- Returns:
- the value of the
gyroYrecord component
-
gyroZ
public double gyroZ()Returns the value of thegyroZrecord component.- Returns:
- the value of the
gyroZrecord component
-
accelX
public double accelX()Returns the value of theaccelXrecord component.- Returns:
- the value of the
accelXrecord component
-
accelY
public double accelY()Returns the value of theaccelYrecord component.- Returns:
- the value of the
accelYrecord component
-
accelZ
public double accelZ()Returns the value of theaccelZrecord component.- Returns:
- the value of the
accelZrecord component
-
imuMode
Returns the value of theimuModerecord component.- Returns:
- the value of the
imuModerecord component
-