StaticIntervalMagnetometerCalibrator

constructor(context: Context, location: Location? = null, timestamp: Date = Date(), worldMagneticModel: WorldMagneticModel? = null, accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, magnetometerSensorType: MagnetometerSensorType = MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, accelerometerSensorDelay: SensorDelay = SensorDelay.FASTEST, magnetometerSensorDelay: SensorDelay = SensorDelay.FASTEST, solveCalibrationWhenEnoughMeasurements: Boolean = true, isMagnetometerGroundTruthInitialHardIron: Boolean = false, initializationStartedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnInitializationStartedListener<StaticIntervalMagnetometerCalibrator>? = null, initializationCompletedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnInitializationCompletedListener<StaticIntervalMagnetometerCalibrator>? = null, errorListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnErrorListener<StaticIntervalMagnetometerCalibrator>? = null, staticIntervalDetectedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnStaticIntervalDetectedListener<StaticIntervalMagnetometerCalibrator>? = null, dynamicIntervalDetectedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnDynamicIntervalDetectedListener<StaticIntervalMagnetometerCalibrator>? = null, staticIntervalSkippedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnStaticIntervalSkippedListener<StaticIntervalMagnetometerCalibrator>? = null, dynamicIntervalSkippedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnDynamicIntervalSkippedListener<StaticIntervalMagnetometerCalibrator>? = null, generatedMagnetometerMeasurementListener: StaticIntervalMagnetometerCalibrator.OnGeneratedMagnetometerMeasurementListener? = null, readyToSolveCalibrationListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnReadyToSolveCalibrationListener<StaticIntervalMagnetometerCalibrator>? = null, calibrationSolvingStartedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnCalibrationSolvingStartedListener<StaticIntervalMagnetometerCalibrator>? = null, calibrationCompletedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnCalibrationCompletedListener<StaticIntervalMagnetometerCalibrator>? = null, stoppedListener: StaticIntervalWithMeasurementGeneratorCalibrator.OnStoppedListener<StaticIntervalMagnetometerCalibrator>? = null, initialMagnetometerHardIronAvailableListener: StaticIntervalMagnetometerCalibrator.OnInitialMagnetometerHardIronAvailableListener? = null, accuracyChangedListener: SensorCollector.OnAccuracyChangedListener? = null, magnetometerQualityScoreMapper: QualityScoreMapper<StandardDeviationBodyMagneticFluxDensity> = DefaultMagnetometerQualityScoreMapper())

Constructor.

Parameters

context

Android context.

location

Current device location. If location and timestamp are provided, calibration will be based on Earth's magnetic model.If no location and timestamp is provided, calibration will be based on measured magnetic flux density norm at current location.

timestamp

Current timestamp.

worldMagneticModel

Earth's magnetic model. Null to use default model.

accelerometerSensorType

One of the supported accelerometer sensor types.

magnetometerSensorType

One of the supported magnetometer sensor types.

accelerometerSensorDelay

Delay of sensor between samples.

magnetometerSensorDelay

Delay of magnetometer sensor between samples.

solveCalibrationWhenEnoughMeasurements

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

isMagnetometerGroundTruthInitialHardIron

true if estimated magnetometer hard iron is assumed to be the true value, false if estimated hard iron is assumed to be only an initial guess. When magnetometerSensorType is MagnetometerSensorType.MAGNETOMETER, hard iron guess is zero, otherwise when it is MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, hard iron guess is the device calibrated values.

initializationStartedListener

listener to notify when initialization starts.

initializationCompletedListener

listener to notify when initialization completes.

errorListener

listener to notify errors.

staticIntervalDetectedListener

listener to notify when a static interval is detected.

dynamicIntervalDetectedListener

listener to notify when a dynamic interval is detected.

staticIntervalSkippedListener

listener to notify when a static interval is skipped if its duration is too short.

dynamicIntervalSkippedListener

listener to notify when a dynamic interval is skipped if its duration is too long.

generatedMagnetometerMeasurementListener

listener to notify when a new magnetometer calibration measurement is generated.

readyToSolveCalibrationListener

listener to notify when enough measurements have been collected and calibrator is ready to solve calibration.

calibrationSolvingStartedListener

listener to notify when calibration solving starts.

calibrationCompletedListener

listener to notify when calibration solving completes.

stoppedListener

listener to notify when calibrator is stopped.

initialMagnetometerHardIronAvailableListener

listener to notify when a guess of hard iron values is obtained.

accuracyChangedListener

listener to notify when sensor accuracy changes.

magnetometerQualityScoreMapper

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