BaseLevelingEstimator2

abstract class BaseLevelingEstimator2<T : BaseLevelingEstimator2<T, L1, L2>, L1 : BaseLevelingEstimator2.OnLevelingAvailableListener<T, L1, L2>, L2 : BaseLevelingEstimator2.OnAccuracyChangedListener<T, L1, L2>>(val context: Context, val sensorDelay: SensorDelay, val useAccelerometer: Boolean, val startOffsetEnabled: Boolean, val accelerometerSensorType: AccelerometerSensorType, val accelerometerAveragingFilter: AveragingFilter, val estimateCoordinateTransformation: Boolean, val estimateEulerAngles: Boolean, var levelingAvailableListener: L1?, var accuracyChangedListener: L2?, adjustGravityNorm: Boolean)

Base class for estimators of device leveling (roll and pitch angles) by estimating gravity vector using accelerometer measurements only. Implementations of this estimator does not estimate attitude yaw angle, as either a magnetometer or gyroscope would be needed.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context, sensorDelay: SensorDelay, useAccelerometer: Boolean, startOffsetEnabled: Boolean, accelerometerSensorType: AccelerometerSensorType, accelerometerAveragingFilter: AveragingFilter, estimateCoordinateTransformation: Boolean, estimateEulerAngles: Boolean, levelingAvailableListener: L1?, accuracyChangedListener: L2?, adjustGravityNorm: Boolean)

Types

Link copied to clipboard

Interface to notify when sensor (either accelerometer or gravity) accuracy changes.

Link copied to clipboard

Interface to notify when a new leveling measurement is available.

Properties

Link copied to clipboard

an averaging filter for accelerometer samples to obtain sensed gravity component of specific force. (Only used if useAccelerometer is true).

Link copied to clipboard

One of the supported accelerometer sensor types. (Only used if useAccelerometer is true).

Link copied to clipboard

listener to notify changes in accuracy.

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

Android context.

Link copied to clipboard

true to estimate coordinate transformation, false otherwise. If not needed, it can be disabled to improve performance and decrease cpu load.

Link copied to clipboard

true to estimate euler angles, false otherwise. If not needed, it can be disabled to improve performance and decrease cpu load.

Link copied to clipboard

listener to notify when a new leveling measurement is available.

Link copied to clipboard

Indicates whether this estimator is running or not.

Link copied to clipboard

Delay of accelerometer or gravity sensor between samples.

Link copied to clipboard

Initial offset expressed in nano seconds between first received measurement timestamp and start time expressed in the monotonically increasing system clock obtained by SystemClock.elapsedRealtimeNanos.

Link copied to clipboard

indicates whether startOffset will be computed when first measurement is received or not. True indicates that offset is computed, false assumes that offset is null.

Link copied to clipboard

true to use accelerometer sensor, false to use system gravity sensor.

Functions

Link copied to clipboard
fun start(startTimestamp: Long = SystemClock.elapsedRealtimeNanos()): Boolean

Starts this estimator.

Link copied to clipboard
fun stop()

Stops this estimator.