Accelerometer


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


Information about car specific accelerometers available from the car hardware.

Summary

Public constructors

Creates an Accelerometer with the given raw data.

Public methods

boolean
@NonNull CarValue<List<Float>>

Returns the raw accelerometer force data from the car sensor.

int
@NonNull String

Public constructors

Accelerometer

Added in 1.1.0
public Accelerometer(@NonNull CarValue<List<Float>> forces)

Creates an Accelerometer with the given raw data.

Throws
java.lang.NullPointerException

if forces is null

Public methods

equals

public boolean equals(@Nullable Object other)

getForces

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

Returns the raw accelerometer force data from the car sensor.

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

  • [0]: Acceleration including gravity on the x-axis
  • [1]: Acceleration including gravity on the y-axis
  • [2]: Acceleration including gravity on the z-axis

hashCode

public int hashCode()

toString

public @NonNull String toString()