GeomagneticAttitudeEstimator

Estimates a leveled absolute attitude using accelerometer (or gravity) and magnetometer sensors. Gyroscope is not used in this estimator. Roll and pitch Euler angles are leveled using accelerometer or gravity sensors. Yaw angle is obtained from magnetometer once the leveling is estimated.

Constructors

Link copied to clipboard
constructor(context: Context, location: Location? = null, sensorDelay: SensorDelay = SensorDelay.GAME, useAccelerometer: Boolean = true, accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, magnetometerSensorType: MagnetometerSensorType = MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, accelerometerAveragingFilter: AveragingFilter = LowPassAveragingFilter(), worldMagneticModel: WorldMagneticModel? = null, timestamp: Date = Date(), useWorldMagneticModel: Boolean = false, useAccurateLevelingEstimator: Boolean = false, estimateCoordinateTransformation: Boolean = false, estimateEulerAngles: Boolean = true, attitudeAvailableListener: GeomagneticAttitudeEstimator.OnAttitudeAvailableListener? = null, accelerometerMeasurementListener: AccelerometerSensorCollector.OnMeasurementListener? = null, gravityMeasurementListener: GravitySensorCollector.OnMeasurementListener? = null, magnetometerMeasurementListener: MagnetometerSensorCollector.OnMeasurementListener? = null, gravityEstimationListener: GravityEstimator.OnEstimationListener? = null)

Constructor.

Types

Link copied to clipboard

Interface to notify when a new attitude 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

listener to notify when a new attitude measurement is available.

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

Gets or sets device location

Link copied to clipboard

listener to notify new magnetometer measurements.

Link copied to clipboard

One of the supported magnetometer sensor types.

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

Timestamp when World Magnetic Model will be evaluated to obtain current magnetic declination. Only taken into account if useWorldMagneticModel is true.

Link copied to clipboard

true to use accelerometer sensor, false to use system gravity sensor for leveling purposes.

Link copied to clipboard

Indicates whether accurate leveling must be used or not.

Link copied to clipboard

Indicates whether world magnetic model is taken into account to adjust attitude yaw angle by current magnetic declination based on current World Magnetic Model, location and timestamp.

Link copied to clipboard
var worldMagneticModel: WorldMagneticModel?

Earth's magnetic model. If null, the default model is used if useWorldMagneticModel is true. If useWorldMagneticModel is false, this is ignored.

Functions

Link copied to clipboard
fun start(): Boolean

Starts this estimator.

Link copied to clipboard
fun stop()

Stops this estimator.