Compass

public final class Compass
extends Object

java.lang.Object
   ↳ androidx.car.app.hardware.info.Compass


Information about car specific compass available from the car hardware.

Summary

Public constructors

Compass(CarValue<List<Float>> orientations)

Creates an Compass with the given raw data.

Public methods

boolean equals(Object other)
CarValue<List<Float>> getOrientations()

Returns the raw compass data from the car sensor.

int hashCode()
String toString()

Inherited methods

Public constructors

Compass

public Compass (CarValue<List<Float>> orientations)

Creates an Compass with the given raw data.

Parameters
orientations CarValue

Throws
NullPointerException if orientations is null

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getOrientations

public CarValue<List<Float>> getOrientations ()

Returns the raw compass data from the car sensor.

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

  • [0]: Azimuth, angle between the magnetic north direction and the y-axis, around the z-axis (0 to 359). 0=North, 90=East, 180=South, 270=West
  • [1]: Pitch, rotation around y-axis (-90 to 90), where nose down is positive
  • [2]: Roll, rotation around x-axis (-180 to 180), where right door down is positive

Returns
CarValue<List<Float>>

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String