BaseLevelingEstimator

abstract class BaseLevelingEstimator<T : BaseLevelingEstimator<T, L>, L : BaseLevelingEstimator.OnLevelingAvailableListener<T, L>>(val context: Context, val sensorDelay: SensorDelay = SensorDelay.GAME, val useAccelerometer: Boolean = false, val accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, val accelerometerAveragingFilter: AveragingFilter = LowPassAveragingFilter(), val estimateCoordinateTransformation: Boolean = false, val estimateEulerAngles: Boolean = true, var levelingAvailableListener: L? = null, var gravityEstimationListener: GravityEstimator.OnEstimationListener? = null)

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 = SensorDelay.GAME, useAccelerometer: Boolean = false, accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, accelerometerAveragingFilter: AveragingFilter = LowPassAveragingFilter(), estimateCoordinateTransformation: Boolean = false, estimateEulerAngles: Boolean = true, levelingAvailableListener: L? = null, gravityEstimationListener: GravityEstimator.OnEstimationListener? = null)

Types

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

Listener to notify new accelerometer measurements. (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

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 gravity estimation is available.

Link copied to clipboard

listener to notify new gravity measurements. (Only used if useAccelerometer is false).

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

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

Functions

Link copied to clipboard
fun start(): Boolean

Starts this estimator.

Link copied to clipboard
fun stop()

Stops this estimator.