org.firstinspires.ftc.robotcore.external.navigation

## Class AngularVelocity

- java.lang.Object
- - org.firstinspires.ftc.robotcore.external.navigation.AngularVelocity

-     public class AngularVelocity
      extends java.lang.Object

  Instances of `AngularVelocity` represent an instantaneous body-referenced 3D rotation rate.

  The instantaneous rate of change of an `Orientation`, which is what we are representing here, has unexpected subtleties. As described in Section 9.3 of the MIT Kinematics Lecture below, the instantaneous body-referenced rotation rate angles are decoupled (their order does not matter) but their conversion into a corresponding instantaneous rate of change of a set of related Euler angles (ie: `Orientation` involves a non-obvious transformation on two of the rotation rates.

  See Also:
    MIT Kinematics Lecture, Understanding Euler Angles, Angular Velocity

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `long` | `acquisitionTime` the time on the System.nanoTime() clock at which the data was acquired.
    `AngleUnit` | `unit` the angular unit in which angular rates are expressed.
    `float` | `xRotationRate` the instantaneous body-referenced rotation rate about the x-axis in units of "`unit`s per second".
    `float` | `yRotationRate` the instantaneous body-referenced rotation rate about the y-axis in units of "`unit`s per second".
    `float` | `zRotationRate` the instantaneous body-referenced rotation rate about the z-axis in units of "`unit`s per second".

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AngularVelocity()`
    `AngularVelocity(AngleUnit unit, float xRotationRate, float yRotationRate, float zRotationRate, long acquisitionTime)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AngularVelocity` | `toAngleUnit(AngleUnit unit)` Converts this `AngularVelocity` to one with the indicated angular units.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### unit

          public AngleUnit unit

      the angular unit in which angular rates are expressed. The time unit thereof is always "per second".

    - #### xRotationRate

          public float xRotationRate

      the instantaneous body-referenced rotation rate about the x-axis in units of "`unit`s per second".

    - #### yRotationRate

          public float yRotationRate

      the instantaneous body-referenced rotation rate about the y-axis in units of "`unit`s per second".

    - #### zRotationRate

          public float zRotationRate

      the instantaneous body-referenced rotation rate about the z-axis in units of "`unit`s per second".

    - #### acquisitionTime

          public long acquisitionTime

      the time on the System.nanoTime() clock at which the data was acquired. If no timestamp is associated with this particular set of data, this value is zero.

  - ### Constructor Detail

    - #### AngularVelocity

          public AngularVelocity()

    - #### AngularVelocity

          public AngularVelocity(AngleUnit unit,
                                 float xRotationRate,
                                 float yRotationRate,
                                 float zRotationRate,
                                 long acquisitionTime)

  - ### Method Detail

    - #### toAngleUnit

          public AngularVelocity toAngleUnit(AngleUnit unit)

      Converts this `AngularVelocity` to one with the indicated angular units.
      Parameters:
        `unit` - the units to use in the returned [@link AngularVelocity}
      Returns:
        a new [@link AngularVelocity} with the same data but in the indicated units