AccelerometerIntervalDetector

class AccelerometerIntervalDetector(context: Context, val sensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, sensorDelay: SensorDelay = SensorDelay.FASTEST, initializationStartedListener: IntervalDetector.OnInitializationStartedListener<AccelerometerIntervalDetector>? = null, initializationCompletedListener: IntervalDetector.OnInitializationCompletedListener<AccelerometerIntervalDetector>? = null, errorListener: IntervalDetector.OnErrorListener<AccelerometerIntervalDetector>? = null, staticIntervalDetectedListener: IntervalDetector.OnStaticIntervalDetectedListener<AccelerometerIntervalDetector>? = null, dynamicIntervalDetectedListener: IntervalDetector.OnDynamicIntervalDetectedListener<AccelerometerIntervalDetector>? = null, resetListener: IntervalDetector.OnResetListener<AccelerometerIntervalDetector>? = null, var measurementListener: AccelerometerSensorCollector.OnMeasurementListener? = null, accuracyChangedListener: SensorCollector.OnAccuracyChangedListener? = null) : IntervalDetector<AccelerometerIntervalDetector, AccelerometerSensorCollector, AccelerationUnit, Acceleration, AccelerationTriad, AccelerationTriadStaticIntervalDetector, AccelerationTriadStaticIntervalDetectorListener>

Detects static or motion intervals of time by using the accelerometer of the device to determine whether the device is moving or not. When detector is started, initialization occurs to determine the accelerometer noise level while keeping device static. Once the detector is initialized, then static or dynamic intervals can be detected. This detector uses accumulated average values during static intervals, and windowed averages as "instantaneous" values during dynamic intervals. Length of windows, as well as thresholds to determine when changes between static and dynamic intervals occur can be easily configured. This interval detector converts sensor measurements from device ENU coordinates to local plane NED coordinates. Thus, all values referring to a given x-y-z coordinate refers to local plane NED system of coordinates.

Constructors

Link copied to clipboard
constructor(context: Context, sensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, sensorDelay: SensorDelay = SensorDelay.FASTEST, initializationStartedListener: IntervalDetector.OnInitializationStartedListener<AccelerometerIntervalDetector>? = null, initializationCompletedListener: IntervalDetector.OnInitializationCompletedListener<AccelerometerIntervalDetector>? = null, errorListener: IntervalDetector.OnErrorListener<AccelerometerIntervalDetector>? = null, staticIntervalDetectedListener: IntervalDetector.OnStaticIntervalDetectedListener<AccelerometerIntervalDetector>? = null, dynamicIntervalDetectedListener: IntervalDetector.OnDynamicIntervalDetectedListener<AccelerometerIntervalDetector>? = null, resetListener: IntervalDetector.OnResetListener<AccelerometerIntervalDetector>? = null, measurementListener: AccelerometerSensorCollector.OnMeasurementListener? = null, accuracyChangedListener: SensorCollector.OnAccuracyChangedListener? = null)

Properties

Link copied to clipboard
val accumulatedAvgTriad: AccelerationTriad

Gets average sensor measurements triad accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after initialization completes.

Link copied to clipboard

Gets average x-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard

Gets average x-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard

Gets average y-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard

Gets average y-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard

Gets average z-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard

Gets average z-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard
val accumulatedStdTriad: AccelerationTriad

Gets standard deviation of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of x-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of x-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of y-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of y-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of z-coordinate of sensor measurements accumulated during last static period expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets standard deviation of z-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

listener to notify when sensor accuracy changes.

Link copied to clipboard

Gets average time interval between sensor samples expressed in seconds (s). This is only available once detector completes initialization.

Link copied to clipboard

Gets average time interval between sensor samples. This is only available once detector completes initialization.

Link copied to clipboard

Gets sensor measurement base noise level that has been detected during initialization expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope and Teslas (T) for magnetometer. This is only available once detector completes initialization.

Link copied to clipboard

Gets or sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes. This threshold is expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope and Teslas (T) for magnetometer.

Gets or sets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes.

Link copied to clipboard
val baseNoiseLevelAsMeasurement: Acceleration?

Gets sensor measurement base noise level that has been detected during initialization. This is only available once detector completes initialization.

Link copied to clipboard

Gets measurement base noise level 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 once detector completes initialization.

Link copied to clipboard

Gets measurement base noise level 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 once detector completes initialization.

Link copied to clipboard

Android context.

Link copied to clipboard
Link copied to clipboard

listener to notify errors such as sudden motion during initialization or sensor unreliability.

Link copied to clipboard

listener to notify when this detector completes initialization after being started.

Link copied to clipboard

listener to notify when this detector starts initialization after being started.

Link copied to clipboard

Gets or sets number of samples to be processed initially while keeping the sensor static in order to find the base noise level when device is static.

Link copied to clipboard
val instantaneousAvgTriad: AccelerationTriad

Gets windowed average of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the samples within the window.

Link copied to clipboard

Gets windowed average x-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets windowed average x-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets windowed average y-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets windowed average y-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets windowed average z-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets windowed average z-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard

Gets or sets factor to determine that a sudden movement has occurred during initialization if instantaneous noise level exceeds accumulated noise level by this factor amount. This factor is unit-less.

Link copied to clipboard
val instantaneousStdTriad: AccelerationTriad

Gets windowed standard deviation of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of x-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of x-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of y-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of y-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of z-coordinate of sensor measurements for each processed triad expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

Gets windowed standard deviation of z-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard

listener to notify collected accelerometer measurements.

Link copied to clipboard

Number of measurements that have been processed.

Link copied to clipboard
Link copied to clipboard

Indicates whether this detector 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
Link copied to clipboard

Gets status of interval detector. Initially the interval detector will be idle. Once it starts, it will start the initialization phase, and once initialization is complete, it will switch between static or dynamic interval until detector is stopped or an error occurs.

Link copied to clipboard

Gets estimated threshold to determine static/dynamic period changes expressed in meters per squared second (m/s^2) for accelerometer, radians per second (rad/s) for gyroscope or Teslas (T) for magnetometer. This is only available once detector completes initialization.

Link copied to clipboard
val thresholdAsMeasurement: Acceleration?

Gets estimated threshold to determine static/dynamic period changes. This is only available once detector completes initialization.

Link copied to clipboard

Gets or sets factor to be applied to detected base noise level in order to determine threshold for static/dynamic period changes. This factor is unit-less.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements expressed in seconds (s). This is only available once detector completes initialization.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. This is only available once detector completes initialization.

Link copied to clipboard

Gets estimated variance of time interval between measurements expressed in squared seconds (s^2). This is only available once detector completes initialization.

Link copied to clipboard

Gets or sets length of number of samples to keep within the window being processed to determine instantaneous sensor noise level. Window size must always be larger than allowed minimum value, which is 2 and must have an odd value.

Functions

Link copied to clipboard
fun getAccumulatedAvgTriad(result: AccelerationTriad)

Gets average sensor measurements triad accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after initialization completes.

Link copied to clipboard
fun getAccumulatedAvgXAsMeasurement(result: Acceleration)

Gets average x-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard
fun getAccumulatedAvgYAsMeasurement(result: Acceleration)

Gets average y-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard
fun getAccumulatedAvgZAsMeasurement(result: Acceleration)

Gets average z-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one, or after initialization completes.

Link copied to clipboard
fun getAccumulatedStdTriad(result: AccelerationTriad)

Gets standard deviation of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard
fun getAccumulatedStdXAsMeasurement(result: Acceleration)

Gets standard deviation of x-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard
fun getAccumulatedStdYAsMeasurement(result: Acceleration)

Gets standard deviation of y-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard
fun getAccumulatedStdZAsMeasurement(result: Acceleration)

Gets standard deviation of z-coordinate of sensor measurements accumulated during last static period. This value is updated when switching from a static period to a dynamic one or after completing initialization.

Link copied to clipboard

Gets average time interval between measurements. This is only available once detector completes initialization.

Gets overall absolute threshold to determine whether there has been excessive motion during the whole initialization phase. Failure will be detected if estimated base noise level exceeds this threshold when initialization completes.

Link copied to clipboard
fun getBaseNoiseLevelAsMeasurement(result: Acceleration): Boolean

Gets sensor measurement base noise level that has been detected during initialization. This is only available once detector completes initialization.

Link copied to clipboard
fun getInstantaneousAvgTriad(result: AccelerationTriad)

Gets windowed average of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the samples within the window.

Link copied to clipboard
fun getInstantaneousAvgXAsMeasurement(result: Acceleration)

Gets windowed average x-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard
fun getInstantaneousAvgYAsMeasurement(result: Acceleration)

Gets windowed average y-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard
fun getInstantaneousAvgZAsMeasurement(result: Acceleration)

Gets windowed average z-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing an average value for the sample within the window.

Link copied to clipboard
fun getInstantaneousStdTriad(result: AccelerationTriad)

Gets windowed standard deviation of measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard
fun getInstantaneousStdXAsMeasurement(result: Acceleration)

Gets windowed standard deviation of x-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard
fun getInstantaneousStdYAsMeasurement(result: Acceleration)

Gets windowed standard deviation of y-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard
fun getInstantaneousStdZAsMeasurement(result: Acceleration)

Gets windowed standard deviation of z-coordinate of sensor measurements for each processed triad. This value is updated for each processed sample containing measured standard deviation for the samples within the window.

Link copied to clipboard
fun getThresholdAsMeasurement(result: Acceleration): Boolean

Gets estimated threshold to determine static/dynamic period changes. This is only available once detector completes initialization.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. This is only available once detector completes initialization.

Link copied to clipboard
fun start()

Starts collection of sensor measurements.

Link copied to clipboard
fun stop()

Stops collection of sensor measurements.