GravityProcessor

Collects gravity measurements based on android coordinates system (ENU), and converts them to NED coordinates system.

Constructors

Link copied to clipboard
constructor(location: Location? = null, adjustGravityNorm: Boolean = true, processorListener: BaseGravityProcessor.OnProcessedListener<GravitySensorMeasurement>? = null)

Properties

Link copied to clipboard

Accuracy of last sensed gravity measurement.

Link copied to clipboard

indicates whether gravity norm must be adjusted to either Earth standard norm, or norm at provided location. If no location is provided, this should only be enabled when device is close to sea level.

Link copied to clipboard

Gets expected gravity norm at provided location. If No location is provided, average gravity at sea level is returned instead. This value will be used to adjust to adjust gravity norm if adjustGravityNorm is true.

Link copied to clipboard
val gravity: AccelerationTriad

Gets a new triad containing gravity component of specific force expressed in NED coordinates and in meters per squared second (m/s^2).

Link copied to clipboard

Gets norm of current gravity.

Link copied to clipboard
var gx: Double

X-coordinates of last sensed gravity component of specific force expressed in NED coordinates and in meters per squared second (m/s^2).

Link copied to clipboard
var gy: Double

Y-coordinate of last sensed gravity component of specific force expressed in NED coordinates and in meters per squared second (m/s^2).

Link copied to clipboard
var gz: Double

Z-coordinate of last sensed gravity component of specific force expressed in NED coordinates and in meters per squared second (m/s^2).

Link copied to clipboard

current device location.

Link copied to clipboard
Link copied to clipboard

Time in nanoseconds at which the measurement was made. Each measurement will be monotonically increasing using the same time base as android.os.SystemClock.elapsedRealtimeNanos.

Functions

Link copied to clipboard
fun getGravity(result: AccelerationTriad)

Updates provided triad to contain gravity component of specific force expressed in NED coordinates and in meters per squared second (m/s^2).

Link copied to clipboard
fun getNedPosition(result: NEDPosition): Boolean

Gets NED position from provided location.

Link copied to clipboard
open override fun process(measurement: GravitySensorMeasurement, timestamp: Long): Boolean

Processes a gravity sensor measurement collected by a collector or a syncer.

Link copied to clipboard
fun reset()

Resets this processor to its initial values.