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

Added in 1.4.0-rc02
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

Added in 1.4.0-rc02
public int hashCode()

toString

Added in 1.4.0-rc02
public @NonNull String toString()