com.qualcomm.robotcore.hardware

## Interface GyroSensor

- All Superinterfaces:
    HardwareDevice

      public interface GyroSensor
      extends HardwareDevice

  Gyro Sensor

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `HardwareDevice.Manufacturer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `calibrate()` Calibrate the gyro.
    `int` | `getHeading()` Return the integrated Z axis as a cartesian heading.
    `double` | `getRotationFraction()` Return the rotation of this sensor expressed as a fraction of the maximum possible reportable rotation
    `boolean` | `isCalibrating()` Is the gyro performing a calibration operation?
    `int` | `rawX()` Return the gyro's raw X value.
    `int` | `rawY()` Return the gyro's raw Y value.
    `int` | `rawZ()` Return the gyro's raw Z value.
    `void` | `resetZAxisIntegrator()` Set the integrated Z axis to zero.
    `java.lang.String` | `status()` Status of this sensor, in string form

    - ### Methods inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `close, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpMode`

- - ### Method Detail

    - #### calibrate

          void calibrate()

      Calibrate the gyro. For the Modern Robotics device this will null, or reset, the Z axis heading.
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### isCalibrating

          boolean isCalibrating()

      Is the gyro performing a calibration operation?
      Returns:
        true if yes, false otherwise
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### getHeading

          int getHeading()

      Return the integrated Z axis as a cartesian heading.
      Returns:
        heading between 0-360.
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### getRotationFraction

          double getRotationFraction()

      Return the rotation of this sensor expressed as a fraction of the maximum possible reportable rotation
      Returns:
        the current fractional rotation of this gyro (a value between 0.0 and 1.0)
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### rawX

          int rawX()

      Return the gyro's raw X value.
      Returns:
        X value
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### rawY

          int rawY()

      Return the gyro's raw Y value.
      Returns:
        Y value
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### rawZ

          int rawZ()

      Return the gyro's raw Z value.
      Returns:
        Z value
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### resetZAxisIntegrator

          void resetZAxisIntegrator()

      Set the integrated Z axis to zero.
      Throws:
        `java.lang.UnsupportedOperationException` - if unsupported; not all gyro devices support this feature

    - #### status

          java.lang.String status()

      Status of this sensor, in string form
      Returns:
        status