SingleSensorStaticIntervalMagnetometerCalibrator

class SingleSensorStaticIntervalMagnetometerCalibrator : SingleSensorStaticIntervalCalibrator<SingleSensorStaticIntervalMagnetometerCalibrator, StandardDeviationBodyMagneticFluxDensity, MagnetometerIntervalDetector, MagneticFluxDensityUnit, MagneticFluxDensity, MagneticFluxDensityTriad>

Collects magnetometer measurements by detecting periods when device captures a constant magnetic field (typically when device orientation remains static). Such static periods are used to obtain measurements and solve calibration parameters. This calibrator DOES NOT require an accelerometer. Only a magnetometer is needed. This calibrator 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.

Constructors

constructor(context: Context, location: Location? = null, timestamp: Date = Date(), worldMagneticModel: WorldMagneticModel? = null, sensorType: MagnetometerSensorType = MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, sensorDelay: SensorDelay = SensorDelay.FASTEST, solveCalibrationWhenEnoughMeasurements: Boolean = true, isGroundTruthInitialHardIron: Boolean = false, initializationStartedListener: SingleSensorStaticIntervalCalibrator.OnInitializationStartedListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, initializationCompletedListener: SingleSensorStaticIntervalCalibrator.OnInitializationCompletedListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, errorListener: SingleSensorStaticIntervalCalibrator.OnErrorListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, initialHardIronAvailableListener: SingleSensorStaticIntervalMagnetometerCalibrator.OnInitialHardIronAvailableListener? = null, newCalibrationMeasurementAvailableListener: SingleSensorStaticIntervalCalibrator.OnNewCalibrationMeasurementAvailableListener<SingleSensorStaticIntervalMagnetometerCalibrator, StandardDeviationBodyMagneticFluxDensity>? = null, readyToSolveCalibrationListener: SingleSensorStaticIntervalCalibrator.OnReadyToSolveCalibrationListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, calibrationSolvingStartedListener: SingleSensorStaticIntervalCalibrator.OnCalibrationSolvingStartedListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, calibrationCompletedListener: SingleSensorStaticIntervalCalibrator.OnCalibrationCompletedListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, stoppedListener: SingleSensorStaticIntervalCalibrator.OnStoppedListener<SingleSensorStaticIntervalMagnetometerCalibrator>? = null, qualityScoreMapper: QualityScoreMapper<StandardDeviationBodyMagneticFluxDensity> = DefaultMagnetometerQualityScoreMapper())

Constructor.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Interface to notify when initial hard iron guess is available. If isGroundTruthInitialHardIron is true, then initial hard iron is considered the true value after solving calibration, otherwise, initial hard iron is considered only an initial guess.

Properties

Link copied to clipboard

Gets average time interval between magnetometer samples expressed in seconds (s). Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

Link copied to clipboard

Gets average time interval between magnetometer samples. Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

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 or Teslas (T) for magnetometer. This is only available once initialization is completed.

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 or 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: MagneticFluxDensity?

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

Link copied to clipboard

Gets measurement base noise level PSD (Power Spectral Density) expressed in (m^2 * s^-3) for accelerometer or (T^2 * s) for magnetometer. This is only available once initialization is completed.

Link copied to clipboard

Gets measurement base noise level root PSD (Power Spectral Density) expressed in (m * s^-1.5) for accelerometer or (T * s^0.5) for magnetometer. This is only available once initialization is completed.

Link copied to clipboard

Android context.

Link copied to clipboard
open override val estimatedChiSq: Double?

Gets estimated chi square value or null if not available.

Link copied to clipboard
open override val estimatedCovariance: Matrix?

Gets estimated covariance matrix for estimated magnetometer parameters or null if not available. When hard iron is known, diagonal elements of the covariance matrix contains variance for the following parameters (following indicated order): sx, sy, sz, mxy, mxz, myz, mzx, mzy. When hard iron is not known, diagonal elements of the covariance matrix contains variance for the following parameters (following indicated order): bx, by, bz, sx, sy, sz, mxy, mxz, myx, myz, mzx, mzy.

Link copied to clipboard
val estimatedHardIronAsTriad: MagneticFluxDensityTriad?

Gets estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronAsTriad, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronAsTriad.

Link copied to clipboard

Gets x coordinate of estimated magnetometer hard iron expressed in Teslas (T). If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronX, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronX.

Link copied to clipboard
val estimatedHardIronXAsMeasurement: MagneticFluxDensity?

Gets x coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronXAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronXAsMeasurement.

Link copied to clipboard

Gets y coordinate of estimated magnetometer hard iron expressed in Teslas (T). If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronY, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronY.

Link copied to clipboard
val estimatedHardIronYAsMeasurement: MagneticFluxDensity?

Gets y coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronYAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronYAsMeasurement.

Link copied to clipboard

Gets z coordinate of estimated magnetometer hard iron expressed in Teslas (T). If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronZ, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronZ.

Link copied to clipboard
val estimatedHardIronZAsMeasurement: MagneticFluxDensity?

Gets z coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronZAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronZAsMeasurement.

Link copied to clipboard
val estimatedMm: Matrix?

Gets estimated magnetometer soft-iron matrix containing scale factors and cross coupling errors., or null if not available. This is the product of matrix Tm containing cross coupling errors and Km containing scaling factors. So tat:

Link copied to clipboard
open override val estimatedMse: Double?

Gets estimated mean square error respect to provided measurements or null if not available.

Link copied to clipboard
open override val estimatedMxy: Double?

Gets estimated x-y cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedMxz: Double?

Gets estimated x-z cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedMyx: Double?

Gets estimated y-x cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedMyz: Double?

Gets estimated y-z cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedMzx: Double?

Gets estimated z-x cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedMzy: Double?

Gets estimated z-y cross-coupling error or null if not available.

Link copied to clipboard
open override val estimatedSx: Double?

Gets estimated x-axis scale factor or null if not available.

Link copied to clipboard
open override val estimatedSy: Double?

Gets estimated y-axis scale factor or null if not available.

Link copied to clipboard
open override val estimatedSz: Double?

Gets estimated z-axis scale factor or null if not available.

Link copied to clipboard
val initialHardIronAsTriad: MagneticFluxDensityTriad?

Gets initial hard iron coordinates used as an initial guess. This value is determined once the calibrator starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the values used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronAsTriad will be equal to this value, otherwise estimatedHardIronAsTriad will be estimated hard iron after solving calibration, which will differ from estimatedHardIronAsTriad.

Link copied to clipboard
Link copied to clipboard

Gets X-coordinate of hard iron used as an initial guess and expressed in Teslas (T). This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronX will be equal to this value, otherwise estimatedHardIronX will be the estimated hard iron after solving calibration, which will differ from initialHardIronX.

Link copied to clipboard
val initialHardIronXAsMeasurement: MagneticFluxDensity?

Gets X-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronX will be equal to this value, otherwise estimatedHardIronX will be the estimated hard iron after solving calibration, which will differ from initialHardIronX.

Link copied to clipboard

Gets Y-coordinate of hard iron used as an initial guess and expressed in Teslas (T). This value is determined once the calibrator starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronY will be equal to this value, otherwise estimatedHardIronY will be the estimated hard iron after solving calibration, which will differ from initialHardIronY.

Link copied to clipboard
val initialHardIronYAsMeasurement: MagneticFluxDensity?

Gets Y-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronY will be equal to this value, otherwise estimatedHardIronY will be the estimated hard iron after solving calibration, which will differ from initialHardIronY.

Link copied to clipboard

Gets Z-coordinate of hard iron used as an initial guess and expressed in Teslas (T). This value is determined once the calibrator starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronZ will be equal to this value, otherwise estimatedHardIronZ will be the estimated hard iron after solving calibration, which will differ from initialHardIronZ.

Link copied to clipboard
val initialHardIronZAsMeasurement: MagneticFluxDensity?

Gets Z-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronZ will be equal to this value, otherwise estimatedHardIronZ will be the estimated hard iron after solving calibration, which will differ from initialHardIronZ.

Link copied to clipboard

Norm of average magnetic flux density obtained during initialization and expressed in Teslas.

Link copied to clipboard
var initialMm: Matrix

Gets or sets initial scaling factors and cross couping errors matrix. This is also known as magnetometer soft-iron matrix.

Link copied to clipboard

Gets or sets initial x-y cross coupling error.

Link copied to clipboard

Gets or sets initial x-z cross coupling error.

Link copied to clipboard

Gets or sets initial y-x cross coupling error.

Link copied to clipboard

Gets or sets initial y-z cross coupling error.

Link copied to clipboard

Gets or sets initial z-x cross coupling error.

Link copied to clipboard

Gets or sets initial z-y cross coupling error.

Link copied to clipboard

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

Link copied to clipboard

Gets or sets initial x scaling factor.

Link copied to clipboard

Gets or sets initial y scaling factor.

Link copied to clipboard

Gets or sets initial z scaling factor.

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

Indicates or specifies whether z-axis is assumed to be common for magnetometer and gyroscope. When enabled, this eliminates 3 variables from Ma matrix.

Link copied to clipboard

Indicates whether initial hard iron is considered a ground-truth known bias. When true, estimated hard irons are exactly equal to the initial ones, otherwise initial hard irons are just an initial guess and estimated ones might differ after solving calibration.

Link copied to clipboard

Indicates whether initial magnetic flux density norm is measured or not. If either location or timestamp is missing, magnetic flux density norm is measured, otherwise an estimation is used based on World Magnetic Model.

Link copied to clipboard
val isReadyToSolveCalibration: <Error class: unknown class>

Indicates whether enough measurements have been picked at static intervals so that the calibration process can be solved.

Link copied to clipboard

Location of device when running calibration. This is only taken into account if both location and timestamp are provided to determine Earth's magnetic field according to provided World Magnetic Model. If either location or timestamp is missing, then measurement of magnetic field norm will be used instead.

Link copied to clipboard

Gets magnetometer sensor being used for interval detection. This can be used to obtain additional information about the sensor.

Link copied to clipboard
var measurements: <Error class: unknown class>

List of measurements that have been collected so far to be used for calibration. Items in return list can be modified if needed, but beware that this might have consequences on solved calibration result.

Link copied to clipboard
open override val minimumRequiredMeasurements: Int

Gets minimum number of required measurements to start calibration. Each time that the device is kept static, a new measurement is collected. When the required number of measurements is collected, calibration can start.

listener to notify when a new calibration measurement is obtained.

Link copied to clipboard
val qualityScoreMapper: QualityScoreMapper<StandardDeviationBodyMagneticFluxDensity>

mapper to convert collected measurements into quality scores, based on the amount of standard deviation (the larger the variability, the worse the score will be).

Link copied to clipboard

Required number of measurements to be collected before calibration can start. The number of required measurements must be greater than minimumRequiredMeasurements, otherwise at least minimumRequiredMeasurements will be collected before calibration can start.

Link copied to clipboard

Confidence of estimated result expressed as a value between 0.0 and 1.0. By default 99% of confidence is used, which indicates that with a probability of 99% estimation will be accurate because chosen sub-samples will be inliers (in other terms, outliers will be correctly discarded). This properly is only taken into account if a not-null robustMethod is specified.

Link copied to clipboard

Maximum number of iterations to attempt to find a robust calibration solution. By default this is 5000. This properly is only taken into account if a not-null robustMethod is specified.

Link copied to clipboard
var robustMethod: RobustEstimatorMethod?

Indicates robust method used to solve calibration. If null, no robust method is used at all, and instead an LMSE solution is found.

Link copied to clipboard

Size of preliminary subsets picked while finding a robust calibration solution. By default this is the minimumRequiredMeasurements, which results in the smallest number of iterations to complete robust algorithms. Larger values can be used to ensure that error in each preliminary solution is minimized among more measurements (thus, softening the effect of outliers), but this comes at the expense of larger number of iterations. This properly is only taken into account if a not-null robustMethod is specified.

Link copied to clipboard

Additional factor to be taken into account for robust methods based on LMedS or PROMedS, where factor is not directly related to LMSE, but to a smaller value.

Link copied to clipboard

Threshold to be used to determine whether a measurement is considered an outlier by robust algorithms or not. Threshold varies depending on chosen robustMethod. By default, if null is provided, the estimated baseNoiseLevel will be used to determine a suitable threshold. Otherwise, if a value is provided, such value will be used instead. This properly is only taken into account if a not-null robustMethod is specified.

Link copied to clipboard

Factor to be used respect estimated base noise level to consider a measurement an outlier when using robust calibration methods. By default this is 3.0 times baseNoiseLevel, which considering the noise level as the standard deviation of a Gaussian distribution, should account for 99% of the cases. Any measurement having an error greater than that in the estimated solution, will be considered an outlier and be discarded.

Link copied to clipboard

Indicates whether calibrator is running. While calibrator is running, calibrator parameters cannot be changed.

Link copied to clipboard

Delay of sensor between samples.

Link copied to clipboard

One of the supported magnetometer sensor types.

Link copied to clipboard

true to automatically solve calibration once enough measurements are available, false otherwise.

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val thresholdAsMeasurement: MagneticFluxDensity?

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

Link copied to clipboard

Gets or sets factor to be applied to detected base noise level in order to determine a 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). Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

Link copied to clipboard

Gets estimated variance of time interval between measurements expressed in squared seconds (s^2). Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

Link copied to clipboard

Gets or sets current timestamp. This is only taken into account if both location and timestamp are provided to determine Earth's magnetic field according to provided World Magnetic Model. If either location or timestamp is missing, then measurement of magnetic field norm will be used instead.

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 during initialization of the interval detector. Window size must always be larger than allowed minimum value, which is 2 and must have an odd value.

Link copied to clipboard
var worldMagneticModel: WorldMagneticModel?

Sets Earth's magnetic model. Null indicates that default model is being used.

Functions

Link copied to clipboard

Solves calibration using collected measurements. This must be explicitly called after enough measurements are collected if solveCalibrationWhenEnoughMeasurements is false.

Link copied to clipboard

Gets average time interval between measurements. Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

fun getBaseNoiseLevelAbsoluteThresholdAsMeasurement(result: MagneticFluxDensity)

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: MagneticFluxDensity): Boolean

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

Link copied to clipboard
fun getEstimatedHardIronAsTriad(result: MagneticFluxDensityTriad): Boolean

Gets estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronAsTriad, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronAsTriad.

Link copied to clipboard
fun getEstimatedHardIronXAsMeasurement(result: MagneticFluxDensity): Boolean

Gets x coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronXAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronXAsMeasurement.

Link copied to clipboard
fun getEstimatedHardIronYAsMeasurement(result: MagneticFluxDensity): Boolean

Gets y coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronYAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronYAsMeasurement.

Link copied to clipboard
fun getEstimatedHardIronZAsMeasurement(result: MagneticFluxDensity): Boolean

Gets z coordinate of estimated magnetometer hard iron. If isGroundTruthInitialHardIron is true, this will be equal to initialHardIronZAsMeasurement, otherwise it will be the estimated value obtained after solving calibration, that might differ from initialHardIronZAsMeasurement.

Link copied to clipboard
fun getInitialHardIronAsTriad(result: MagneticFluxDensityTriad): Boolean

Gets initial hard iron coordinates used as an initial guess. This value is determined once the calibrator starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the values used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronAsTriad will be equal to this value, otherwise estimatedHardIronAsTriad will be estimated hard iron after solving calibration, which will differ from estimatedHardIronAsTriad.

Link copied to clipboard
fun getInitialHardIronXAsMeasurement(result: MagneticFluxDensity): Boolean

Gets X-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronX will be equal to this value, otherwise estimatedHardIronX will be the estimated hard iron after solving calibration, which will differ from initialHardIronX.

Link copied to clipboard
fun getInitialHardIronYAsMeasurement(result: MagneticFluxDensity): Boolean

Gets Y-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronY will be equal to this value, otherwise estimatedHardIronY will be the estimated hard iron after solving calibration, which will differ from initialHardIronY.

Link copied to clipboard
fun getInitialHardIronZAsMeasurement(result: MagneticFluxDensity): Boolean

Gets Z-coordinate of hard iron used as an initial guess. This value is determined once the calibration starts. If sensorType is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, this will be equal to the value used internally by the device as part of the magnetometer hardware calibration. If sensorType is MagnetometerSensorType.MAGNETOMETER, then magnetometer sensor measurements are assumed to be already hard iron compensated, and the initial hard iron is assumed to be zero. If isGroundTruthInitialHardIron is true, this is assumed to be the true hard iron, and estimatedHardIronZ will be equal to this value, otherwise estimatedHardIronZ will be the estimated hard iron after solving calibration, which will differ from initialHardIronZ.

Link copied to clipboard
fun getInitialMm(result: Matrix)

Gets initial scale factors and cross coupling errors matrix. This is also known as magnetometer soft-iron matrix.

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

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

Link copied to clipboard

Gets estimated standard deviation of time interval between measurements. Time interval is estimated only while initialization is running, consequently, this is only available once initialization is completed.

Link copied to clipboard
fun setInitialCrossCouplingErrors(initialMxy: Double, initialMxz: Double, initialMyx: Double, initialMyz: Double, initialMzx: Double, initialMzy: Double)

Sets initial cross coupling errors.

Link copied to clipboard
fun setInitialScalingFactors(initialSx: Double, initialSy: Double, initialSz: Double)

Sets initial scaling factors.

fun setInitialScalingFactorsAndCrossCouplingErrors(initialSx: Double, initialSy: Double, initialSz: Double, initialMxy: Double, initialMxz: Double, initialMyx: Double, initialMyz: Double, initialMzx: Double, initialMzy: Double)

Sets initial scaling factors and cross couping errors.

Link copied to clipboard
open fun start()

Starts calibrator. This method starts collecting sensor measurements. When calibrator is started, it begins with an initialization stage where sensor noise is estimated while device remains static. Once initialization is completed, calibrator determines intervals where device remains static when device has different poses, so that measurements are collected to solve calibration. If solveCalibrationWhenEnoughMeasurements is true, calibration is automatically solved once enough measurements are collected, otherwise a call to calibrate must be done to solve calibration.

Link copied to clipboard
fun stop()

Stops calibrator. When this is called, no more sensor measurements are collected.