AttitudeEstimator2

class AttitudeEstimator2(val context: Context, val sensorDelay: SensorDelay = SensorDelay.GAME, val attitudeSensorType: AttitudeSensorType = AttitudeSensorType.ABSOLUTE_ATTITUDE, val startOffsetEnabled: Boolean = true, val estimateCoordinateTransformation: Boolean = false, val estimateEulerAngles: Boolean = true, var attitudeAvailableListener: AttitudeEstimator2.OnAttitudeAvailableListener? = null, var accuracyChangedListener: AttitudeEstimator2.OnAccuracyChangedListener? = null)

Estimates absolute or relative attitude using Android rotation vector sensors. When using an AttitudeSensorType.ABSOLUTE_ATTITUDE, android combines accelerometer and magnetometer measurements to obtain a leveled absolute attitude respect to Earth. When using an AttitudeSensorType.RELATIVE_ATTITUDE, android does not use a magnetometer and a leveled attitude is obtained with an arbitrary yaw angle respect to Earth.

Constructors

Link copied to clipboard
constructor(context: Context, sensorDelay: SensorDelay = SensorDelay.GAME, attitudeSensorType: AttitudeSensorType = AttitudeSensorType.ABSOLUTE_ATTITUDE, startOffsetEnabled: Boolean = true, estimateCoordinateTransformation: Boolean = false, estimateEulerAngles: Boolean = true, attitudeAvailableListener: AttitudeEstimator2.OnAttitudeAvailableListener? = null, accuracyChangedListener: AttitudeEstimator2.OnAccuracyChangedListener? = null)

Types

Link copied to clipboard

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

Link copied to clipboard

Interface to notify when a new absolute or relative attitude measurement is available.

Properties

Link copied to clipboard

listener to notify changes in accuracy.

Link copied to clipboard

listener to notify when a new attitude measurement is available.

Link copied to clipboard

One of the supported attitude sensor types.

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

Indicates whether this estimator is running or not.

Link copied to clipboard

Delay of sensors between samples.

Link copied to clipboard

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

Functions

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

Starts this estimator.

Link copied to clipboard
fun stop()

Stops this estimator.