# Gyroscope

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/hardware/info/Gyroscope.java+class:androidx.car.app.hardware.info.Gyroscope) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***


```
@CarProtocol
@RequiresCarApi(value = 3)
public final class Gyroscope
```

<br />

*** ** * ** ***

Information about car specific gyroscopes available from the car hardware.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope#Gyroscope(androidx.car.app.hardware.common.CarValue<java.util.List<java.lang.Float>>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/Float.html>> rotations)` Creates an `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope` with the given raw data. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/Float.html>>` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope#getRotations()()` Returns the raw gyroscope data from the car sensor. |
| `int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope#toString()()` |

## Public constructors

### Gyroscope

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public Gyroscope(@NonNull CarValue<List<Float>> rotations)
```

Creates an `https://developer.android.com/reference/androidx/car/app/hardware/info/Gyroscope` with the given raw data.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `rotations` is `null` |

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getRotations

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public @NonNull CarValue<List<Float>> getRotations()
```

Returns the raw gyroscope data from the car sensor.

Individual values can be `Float.Nan` if not reported. The array values consist of:

- \[0\]: X component of rotation, in rad/s
- \[1\]: Y component of rotation, in rad/s
- \[2\]: Z component of rotation, in rad/s

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```