AccelerometerNoiseEstimator

class AccelerometerNoiseEstimator(context: Context, val sensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, 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<AccelerometerNoiseEstimator>? = null, unreliableListener: AccumulatedTriadEstimator.OnUnreliableListener<AccelerometerNoiseEstimator>? = null, var measurementListener: AccelerometerSensorCollector.OnMeasurementListener? = null) : AccumulatedTriadEstimator<AccelerometerNoiseEstimator, AccumulatedAccelerationTriadNoiseEstimator, AccelerometerSensorCollector, AccelerationUnit, Acceleration, AccelerationTriad>

Estimates accelerometer noise. This estimator takes a given number of accelerometer measurements during a given duration of time to estimate accelerometer measurements average, standard deviation and variance, as well as average time interval between measurements. To be able to measure accelerometer noise, device should remain static so that average accelerometer measurements are constant and their standard deviations reflect actual sensor noise. 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

context

Android context.

sensorDelay

Delay of sensor between samples.

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.

completedListener

Listener to notify when estimation is complete.

unreliableListener

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

Throws

when either maxSamples or maxDurationMillis is negative.

Constructors

Link copied to clipboard
constructor(context: Context, sensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, 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<AccelerometerNoiseEstimator>? = null, unreliableListener: AccumulatedTriadEstimator.OnUnreliableListener<AccelerometerNoiseEstimator>? = null, measurementListener: AccelerometerSensorCollector.OnMeasurementListener? = null)

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
val averageNormAsMeasurement: Acceleration?

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
val averageTriad: AccelerationTriad?

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
val averageXAsMeasurement: Acceleration?

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
val averageYAsMeasurement: Acceleration?

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
val averageZAsMeasurement: Acceleration?

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
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

Listener to notify collected sensor measurements.

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

One of the supported accelerometer sensor types.

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
val standardDeviationTriad: AccelerationTriad?

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
fun getAverageNormAsMeasurement(result: Acceleration): Boolean

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: AccelerationTriad): 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
fun getAverageXAsMeasurement(result: Acceleration): Boolean

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
fun getAverageYAsMeasurement(result: Acceleration): Boolean

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
fun getAverageZAsMeasurement(result: Acceleration): Boolean

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
fun getStandardDeviationTriad(result: AccelerationTriad): Boolean

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
fun getStandardDeviationXAsMeasurement(result: Acceleration): Boolean

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
fun getStandardDeviationYAsMeasurement(result: Acceleration): Boolean

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
fun getStandardDeviationZAsMeasurement(result: Acceleration): Boolean

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.