Compass


@CarProtocol
@RequiresCarApi(value = 3)
public final class Compass


Information about car specific compass available from the car hardware.

Summary

Public constructors

Compass(@NonNull CarValue<List<Float>> orientations)

Creates an Compass with the given raw data.

Public methods

boolean
@NonNull CarValue<List<Float>>

Returns the raw compass data from the car sensor.

int
@NonNull String

Public constructors

Compass

Added in 1.1.0
public Compass(@NonNull CarValue<List<Float>> orientations)

Creates an Compass with the given raw data.

Throws
java.lang.NullPointerException

if orientations is null

Public methods

equals

public boolean equals(@Nullable Object other)

getOrientations

Added in 1.1.0
public @NonNull 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

hashCode

public int hashCode()

toString

public @NonNull String toString()