AccumulatedTriadEstimator

abstract class AccumulatedTriadEstimator<A : AccumulatedTriadEstimator<A, N, C, U, M, T>, N : AccumulatedTriadNoiseEstimator<U, M, T, *, *>, C : SensorCollector, U : Enum<*>, M : Measurement<U>, T : Triad<U, M>>(val context: Context, val sensorDelay: SensorDelay = SensorDelay.FASTEST, maxSamples: Int = DEFAULT_MAX_SAMPLES, maxDurationMillis: Long = DEFAULT_MAX_DURATION_MILLIS, val stopMode: StopMode = StopMode.MAX_SAMPLES_OR_DURATION, var completedListener: AccumulatedTriadEstimator.OnEstimationCompletedListener<A>? = null, var unreliableListener: AccumulatedTriadEstimator.OnUnreliableListener<A>? = null) : BaseAccumulatedEstimator

Estimates the accumulated mean values of a triad of measurements. This estimator takes a given number of measurement triads (acceleration, angular speed, magnetic field, etc) during a given duration of time to estimate measurement averages, standard deviations, variances, as well as average time interval between measurements. For best accuracy of estimated results, device should remain static while data is being collected. This estimator converts sensor measurements from device ENU coordinates to local plane NED coordinates. Thus, all values referring to a given x-y-z coordinates refers to local plane NED system of coordinates.

Parameters

maxSamples

Maximum number of samples to take into account before completion. This is only taken into account if using either StopMode.MAX_SAMPLES_ONLY or StopMode.MAX_SAMPLES_OR_DURATION.

maxDurationMillis

Maximum duration expressed in milliseconds to take into account before completion. This is only taken into account if using either StopMode.MAX_DURATION_ONLY or StopMode.MAX_SAMPLES_OR_DURATION.

stopMode

Determines when this estimator will consider its estimation completed.

Throws

when either maxSamples or maxDurationMillis is negative.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context, sensorDelay: SensorDelay = SensorDelay.FASTEST, maxSamples: Int = DEFAULT_MAX_SAMPLES, maxDurationMillis: Long = DEFAULT_MAX_DURATION_MILLIS, stopMode: StopMode = StopMode.MAX_SAMPLES_OR_DURATION, completedListener: AccumulatedTriadEstimator.OnEstimationCompletedListener<A>? = null, unreliableListener: AccumulatedTriadEstimator.OnUnreliableListener<A>? = null)

Types

Link copied to clipboard
fun interface OnEstimationCompletedListener<A : AccumulatedTriadEstimator<*, *, *, *, *, *>>

Interface to notify when estimation completes.

Link copied to clipboard
fun interface OnUnreliableListener<A : AccumulatedTriadEstimator<*, *, *, *, *, *>>

Interface to notify when measurements become unreliable.

Properties

Link copied to clipboard

Gets average sensor measurement noise PSD (Power Spectral Density) expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Gets estimated average norm of sensor measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to gravity norm (for accelerometer sensor), Earth rotation rate (for gyroscope sensor), or magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average norm of sensor measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to gravity norm (for accelerometer sensor), Earth rotation rate (for gyroscope sensor), or magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets average of estimated standard deviations of sensor measurements expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets average of estimated standard deviations of sensor measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets average time interval between measurements expressed in seconds (s). This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard

Gets average time interval between measurements. This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard

Gets estimated average values of sensor. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of sensor x-axis measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of sensor x-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of accelerometer y-axis measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of accelerometer y-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of accelerometer z-axis measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of sensor z-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Listener to notify when estimation is complete.

Link copied to clipboard

Android context.

Link copied to clipboard
val elapsedTime: Time

Gets amount of elapsed time to compute sensor noise, either if computation succeeds or not.

Link copied to clipboard

Gets amount of elapsed time to compute sensor noise estimation expressed in nanoseconds (ns), either if computation succeeds or not.

Link copied to clipboard

Gets maximum duration expressed in milliseconds to take into account before completion. This is only taken into account if using either StopMode.MAX_DURATION_ONLY or StopMode.MAX_SAMPLES_OR_DURATION.

Link copied to clipboard

Gets maximum number of samples to take into account before completion. This is only taken into account if using either StopMode.MAX_SAMPLES_ONLY or StopMode.MAX_SAMPLES_OR_DURATION.

Link copied to clipboard

Gets norm of sensor noise root PSD (Power Spectral Density) expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Number of measurements that have been processed.

Link copied to clipboard
val psdX: Double?

Gets sensor noise PSD (Power Spectral Density) on x axis expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard
val psdY: Double?

Gets sensor noise PSD (Power Spectral Density) on y axis expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard
val psdZ: Double?

Gets sensor noise PSD (Power Spectral Density) on z axis expressed in (m^2 * s^-3) for accelerometer, (rad^2/s) for gyroscope or (T^2 * s) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Indicates whether estimated average and time interval between measurements are available or not.

Link copied to clipboard

Indicates whether estimated result is unreliable or not.

Link copied to clipboard

Gets sensor noise root PSD (Power Spectral Density) on x axis expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Gets sensor noise root PSD (Power Spectral Density) on y axis expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Gets sensor noise root PSD (Power Spectral Density) on z axis expressed in (m * s^-1.5) for accelerometer, (rad * s^-0.5) for gyroscope or (T * s^0.5) for magnetometer. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Indicates whether this estimator is already running.

Link copied to clipboard

Gets sensor being used to obtain measurements or null if not available. This can be used to obtain additional information about the sensor.

Link copied to clipboard

Delay of sensor between samples.

Link copied to clipboard

Gets norm of estimated standard deviations of sensor measurements expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets norm of estimated standard deviations of sensor measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation values of sensor. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor x-axis measurements expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor x-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor y-axis measurements expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor y-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor z-axis measurements expressed in its default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor z-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Determines when this estimator will consider its estimation completed.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements expressed in seconds (s). This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard

Gets estimated variance of time interval between measurements expressed in squared seconds (s^2). This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard

Listener to notify when sensor becomes unreliable, and thus, estimation must be discarded.

Link copied to clipboard

Gets estimated variance value of sensor x-axis measurements expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this variance is an indication of sensor noise.

Link copied to clipboard

Gets estimated variance value of sensor y-axis measurements expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this variance is an indication of sensor noise.

Link copied to clipboard

Gets estimated variance value of sensor z-axis measurements expressed in its default squared unit (m^2/s^4 for acceleration, rad^2/s^2 for angular speed or T^2 for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this variance is an indication of sensor noise.

Functions

Link copied to clipboard

Gets estimated average norm of sensor measurements expressed in sensor default unit (m/s^2 for acceleration, rad/s for angular speed or T for magnetic flux density). This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to gravity norm (for accelerometer sensor), Earth rotation rate (for gyroscope sensor), or magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets average of estimated standard deviations of sensor measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets average time interval between measurements. This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard
fun getAverageTriad(result: T): Boolean

Gets estimated average values of sensor. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of sensor x-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of accelerometer y-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard

Gets estimated average value of sensor z-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this should be equal to the x-axis component of gravity acceleration (for accelerometer sensor), x-axis component of Earth rotation rate (for gyroscope sensor), or x-axis component of magnetic field intensity (for magnetometer).

Link copied to clipboard
fun getElapsedTime(result: Time)

Gets amount of time elapsed, either if computation succeeds or not.

Link copied to clipboard

Gets norm of estimated standard deviations of sensor measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation values of sensor. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor x-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor y-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation value of sensor z-axis measurements. This is only available when estimation completes successfully and resultAvailable is true. If device remained completely static during estimation, this standard deviation is an indication of sensor noise.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. This is only available when estimation completes successfully and resultAvailable is true.

Link copied to clipboard
fun start()

Starts collection of sensor measurements.

Link copied to clipboard
fun stop()

Stops collection of sensor measurements.