Class KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
java.lang.Object
com.irurueta.navigation.inertial.calibration.magnetometer.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
- All Implemented Interfaces:
KnownFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,,KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener> MagnetometerCalibrator,MagnetometerNonLinearCalibrator,UnknownHardIronMagnetometerCalibrator,UnknownHardIronNonLinearMagnetometerCalibrator,UnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator
public class KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
extends Object
implements KnownFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener>, MagnetometerNonLinearCalibrator, UnknownHardIronNonLinearMagnetometerCalibrator, UnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator
Estimates magnetometer hard-iron biases, cross couplings and scaling
factors.
This calibrator uses an iterative approach to find a minimum least squared error solution.
To use this calibrator at least 4 measurements at different known frames must be provided. In other words, magnetometer samples must be obtained at 4 different positions or orientations. Notice that frame velocities are ignored by this calibrator.
Measured magnetic flux density is assumed to follow the model shown below:
mBmeas = bm + (I + Mm) * mBtrue + w
Where:
- mBmeas is the measured magnetic flux density. This is a 3x1 vector.
- bm is magnetometer hard-iron bias. Ideally, on a perfect magnetometer,
this should be a 3x1 zero vector.
- I is the 3x3 identity matrix.
- Mm is the 3x3 soft-iron matrix containing cross-couplings and scaling
factors. Ideally, on a perfect magnetometer, this should be a 3x3 zero
matrix.
- mBtrue is ground-truth magnetic flux density. This is a 3x1 vector.
- w is measurement noise. This is a 3x1 vector.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intNumber of unknowns when common z-axis is assumed for the accelerometer, gyroscope and magnetometer.private booleanThis flag indicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer.static final booleanIndicates whether by default a common z-axis is assumed for the accelerometer, gyroscope and magnetometer.private doubleEstimated chi square value.private intEstimated degrees of freedom of chi square value.private com.irurueta.algebra.MatrixEstimated covariance matrix for estimated parameters.private double[]Estimated magnetometer hard-iron biases for each magnetometer axis expressed in Teslas (T).private com.irurueta.algebra.MatrixEstimated magnetometer soft-iron matrix containing scale factors and cross coupling errors.private doubleEstimated mean square error respect to provided measurements.private doubleEstimated probability of finding a smaller chi square value expressed as a value between 0.0 and 1.0.private doubleEstimated measure of quality of estimated fit as a value between 0.0 and 1.0.private doubleEstimated reduced chi square value.private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiVariateFitterLevenberg-Marquardt fitter to find a non-linear solution.private static final intNumber of unknowns for the general case.private doubleInitial x-coordinate of hard-iron bias to be used to find a solution.private doubleInitial y-coordinate of hard-iron bias to be used to find a solution.private doubleInitial z-coordinate of hard-iron bias to be used to find a solution.private doubleInitial x-y cross coupling error.private doubleInitial x-z cross coupling error.private doubleInitial y-x cross coupling error.private doubleInitial y-z cross coupling error.private doubleInitial z-x cross coupling error.private doubleInitial z-y cross coupling error.private doubleInitial x scaling factor.private doubleInitial y scaling factor.private doubleInitial z scaling factor.Listener to handle events raised by this calibrator.private WorldMagneticModelContains Earth's magnetic model.Contains a collection of body magnetic flux density measurements taken at different frames (positions and orientations) and containing the standard deviation of magnetometer measurements.static final intRequired minimum number of measurements.private booleanIndicates whether calibrator is running. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, WorldMagneticModel magneticModel, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) ConstructorConstructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(WorldMagneticModel magneticModel, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double[] initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double[] initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double initialHardIronX, double initialHardIronY, double initialHardIronZ, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix initialHardIron, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidEstimates magnetometer calibration parameters containing scale factors and cross-coupling errors.private voidInternal method to perform calibration when common z-axis is assumed for both the accelerometer and gyroscope.private voidInternal method to perform general calibration.private static doubleconvertMagneticFluxDensity(double value, com.irurueta.units.MagneticFluxDensityUnit unit) Converts magnetic flux density value and unit to Teslas.private static doubleconvertMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity magneticFluxDensity) Converts magnetic flux density instance to Teslas.doubleGets estimated chi square value.intGets estimated chi square degrees of freedom.com.irurueta.algebra.MatrixGets estimated covariance matrix for estimated calibration parameters.double[]Gets array containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).booleangetEstimatedHardIron(double[] result) Gets array containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).com.irurueta.algebra.MatrixGets column matrix containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).booleangetEstimatedHardIronAsMatrix(com.irurueta.algebra.Matrix result) Gets column matrix containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).Gets estimated magnetometer bias.booleanGets estimated magnetometer bias.Gets standard deviation of estimated magnetometer bias coordinates.booleanGets standard deviation of estimated magnetometer bias coordinates.Gets average of estimated standard deviation of magnetometer bias coordinates expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets average of estimated standard deviation of magnetometer bias coordinates.booleangetEstimatedHardIronStandardDeviationAverageAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets average of estimated standard deviation of magnetometer bias coordinates.Gets norm of estimated standard deviation of magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets norm of estimated standard deviation of magnetometer bias.booleangetEstimatedHardIronStandardDeviationNormAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets norm of estimated standard deviation of magnetometer bias.Gets x coordinate of estimated magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets x coordinate of estimated magnetometer bias.booleangetEstimatedHardIronXAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets x coordinate of estimated magnetometer bias.Gets standard deviation of estimated x coordinate of magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets standard deviation of estimated x coordinate of magnetometer bias.booleangetEstimatedHardIronXStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated x coordinate of magnetometer bias.Gets variance of estimated x coordinate of magnetometer bias expressed in squared Teslas (T^2).Gets y coordinate of estimated magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets y coordinate of estimated magnetometer bias.booleangetEstimatedHardIronYAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets y coordinate of estimated magnetometer bias.Gets standard deviation of estimated y coordinate of magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets standard deviation of estimated y coordinate of magnetometer bias.booleangetEstimatedHardIronYStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated y coordinate of magnetometer bias.Gets variance of estimated y coordinate of magnetometer bias expressed in squared Teslas (T^2).Gets z coordinate of estimated magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets z coordinate of estimated magnetometer bias.booleangetEstimatedHardIronZAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets z coordinate of estimated magnetometer bias.Gets standard deviation of estimated z coordinate of magnetometer bias expressed in Teslas (T).com.irurueta.units.MagneticFluxDensityGets standard deviation of estimated z coordinate of magnetometer bias.booleangetEstimatedHardIronZStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated z coordinate of magnetometer bias.Gets variance of estimated z coordinate of magnetometer bias expressed in squared Teslas (T^2).com.irurueta.algebra.MatrixGets estimated magnetometer soft-iron matrix containing scale factors and cross coupling errors.doubleGets estimated mean square error respect to provided measurements.Gets estimated x-y cross-coupling error.Gets estimated x-z cross-coupling error.Gets estimated y-x cross-coupling error.Gets estimated y-z cross-coupling error.Gets estimated z-x cross-coupling error.Gets estimated z-y cross-coupling error.doubleGets estimated probability of finding a smaller chi square value expressed as a value between 0.0 and 1.0.doubleGets estimated measure of quality of estimated fit as a value between 0.0 and 1.0.doubleGets estimated reduced chi square value.Gets estimated x-axis scale factor.Gets estimated y-axis scale factor.Gets estimated z-axis scale factor.double[]Gets initial hard-iron bias to be used to find a solution as an array.voidgetInitialHardIron(double[] result) Gets initial hard-iron bias to be used to find a solution as an array.com.irurueta.algebra.MatrixGets initial hard-iron bias to be used to find a solution as a column matrix.voidgetInitialHardIronAsMatrix(com.irurueta.algebra.Matrix result) Gets initial hard-iron bias to be used to find a solution as a column matrix.Gets initial hard-iron used to find a solution.voidGets initial hard-iron used to find a solution.doubleGets initial x-coordinate of magnetometer hard-iron bias to be used to find a solution.com.irurueta.units.MagneticFluxDensityGets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.voidgetInitialHardIronXAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.doubleGets initial y-coordinate of magnetometer hard-iron bias to be used to find a solution.com.irurueta.units.MagneticFluxDensityGets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.voidgetInitialHardIronYAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.doubleGets initial z-coordinate of magnetometer hard-iron bias to be used to find a solution.com.irurueta.units.MagneticFluxDensityGets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.voidgetInitialHardIronZAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.com.irurueta.algebra.MatrixGets initial scale factors and cross coupling errors matrix.voidgetInitialMm(com.irurueta.algebra.Matrix result) Gets initial scale factors and cross coupling errors matrix.doubleGets initial x-y cross coupling error.doubleGets initial x-z cross coupling error.doubleGets initial y-x cross coupling error.doubleGets initial y-z cross coupling error.doubleGets initial z-x cross coupling error.doubleGets initial z-y cross coupling error.doubleGets initial x scaling factor.doubleGets initial y scaling factor.doubleGets initial z scaling factor.Gets listener to handle events raised by this calibrator.Gets Earth's magnetic model.Gets a collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities).Indicates the type of measurement used by this calibrator.intGets minimum number of required measurements.booleanIndicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer.booleanIndicates whether this calibrator requires ordered measurements in a list or not.booleanIndicates whether this calibrator requires quality scores for each measurement or not.booleanisReady()Indicates whether calibrator is ready to start the estimator.booleanIndicates whether calibrator is currently running or no.voidsetCommonAxisUsed(boolean commonAxisUsed) Specifies whether z-axis is assumed to be common for accelerometer and gyroscope.voidsetInitialCrossCouplingErrors(double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Sets initial cross coupling errors.voidsetInitialHardIron(double[] initialHardIron) Sets initial hard-iron bias to be used to find a solution as an array.voidsetInitialHardIron(double initialHardIronX, double initialHardIronY, double initialHardIronZ) Sets initial hard-iron bias coordinates of magnetometer used to find a solution expressed in Teslas (T).voidsetInitialHardIron(com.irurueta.algebra.Matrix initialHardIron) Sets initial hard-iron bias to be used to find a solution as a column matrix with values expressed in Teslas (T).voidsetInitialHardIron(MagneticFluxDensityTriad initialHardIron) Sets initial hard-iron used to find a solution.voidsetInitialHardIron(com.irurueta.units.MagneticFluxDensity initialHardIronX, com.irurueta.units.MagneticFluxDensity initialHardIronY, com.irurueta.units.MagneticFluxDensity initialHardIronZ) Sets initial hard iron coordinates of magnetometer used to find a solution.voidsetInitialHardIronX(double initialHardIronX) Sets initial x-coordinate of magnetometer hard-iron bias to be used to find a solution.voidsetInitialHardIronX(com.irurueta.units.MagneticFluxDensity initialHardIronX) Sets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.voidsetInitialHardIronY(double initialHardIronY) Sets initial y-coordinate of magnetometer hard-iron bias to be used to find a solution.voidsetInitialHardIronY(com.irurueta.units.MagneticFluxDensity initialHardIronY) Sets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.voidsetInitialHardIronZ(double initialHardIronZ) Sets initial z-coordinate of magnetometer hard-iron bias to be used to find a solution.voidsetInitialHardIronZ(com.irurueta.units.MagneticFluxDensity initialHardIronZ) Sets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.voidsetInitialMm(com.irurueta.algebra.Matrix initialMm) Sets initial scale factors and cross coupling errors matrix.voidsetInitialMxy(double initialMxy) Sets initial x-y cross coupling error.voidsetInitialMxz(double initialMxz) Sets initial x-z cross coupling error.voidsetInitialMyx(double initialMyx) Sets initial y-x cross coupling error.voidsetInitialMyz(double initialMyz) Sets initial y-z cross coupling error.voidsetInitialMzx(double initialMzx) Sets initial z-x cross coupling error.voidsetInitialMzy(double initialMzy) Sets initial z-y cross coupling error.voidsetInitialScalingFactors(double initialSx, double initialSy, double initialSz) Sets initial scaling factors.voidsetInitialScalingFactorsAndCrossCouplingErrors(double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Sets initial scaling factors and cross coupling errors.voidsetInitialSx(double initialSx) Sets initial x scaling factor.voidsetInitialSy(double initialSy) Sets initial y scaling factor.voidsetInitialSz(double initialSz) Sets initial z scaling factor.private voidSets input data into Levenberg-Marquardt fitter.voidSets listener to handle events raised by this calibrator.voidsetMagneticModel(WorldMagneticModel magneticModel) Sets Earth's magnetic model.voidsetMeasurements(Collection<? extends StandardDeviationFrameBodyMagneticFluxDensity> measurements) Sets a collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities).
-
Field Details
-
DEFAULT_USE_COMMON_Z_AXIS
public static final boolean DEFAULT_USE_COMMON_Z_AXISIndicates whether by default a common z-axis is assumed for the accelerometer, gyroscope and magnetometer.- See Also:
-
MINIMUM_MEASUREMENTS
public static final int MINIMUM_MEASUREMENTSRequired minimum number of measurements.- See Also:
-
COMMON_Z_AXIS_UNKNOWNS
private static final int COMMON_Z_AXIS_UNKNOWNSNumber of unknowns when common z-axis is assumed for the accelerometer, gyroscope and magnetometer.- See Also:
-
GENERAL_UNKNOWNS
private static final int GENERAL_UNKNOWNSNumber of unknowns for the general case.- See Also:
-
fitter
private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiVariateFitter fitterLevenberg-Marquardt fitter to find a non-linear solution. -
initialHardIronX
private double initialHardIronXInitial x-coordinate of hard-iron bias to be used to find a solution. This is expressed in Teslas (T). -
initialHardIronY
private double initialHardIronYInitial y-coordinate of hard-iron bias to be used to find a solution. This is expressed in Teslas (T). -
initialHardIronZ
private double initialHardIronZInitial z-coordinate of hard-iron bias to be used to find a solution. This is expressed in Teslas (T). -
initialSx
private double initialSxInitial x scaling factor. -
initialSy
private double initialSyInitial y scaling factor. -
initialSz
private double initialSzInitial z scaling factor. -
initialMxy
private double initialMxyInitial x-y cross coupling error. -
initialMxz
private double initialMxzInitial x-z cross coupling error. -
initialMyx
private double initialMyxInitial y-x cross coupling error. -
initialMyz
private double initialMyzInitial y-z cross coupling error. -
initialMzx
private double initialMzxInitial z-x cross coupling error. -
initialMzy
private double initialMzyInitial z-y cross coupling error. -
measurements
Contains a collection of body magnetic flux density measurements taken at different frames (positions and orientations) and containing the standard deviation of magnetometer measurements. If a single device magnetometer needs to be calibrated, typically all measurements are taken at the same position, with zero velocity and multiple orientations. However, if we just want to calibrate a given magnetometer model (e.g. obtain an average and less precise calibration for the magnetometer of a given phone model), we could take measurements collected throughout the planet at multiple positions while the phone remains static (e.g. while charging), hence each measurement position will change, velocity will remain zero and orientation will be typically constant at horizontal orientation while the phone remains on a flat surface. -
commonAxisUsed
private boolean commonAxisUsedThis flag indicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer. When enabled, this eliminates 3 variables from Mm matrix. -
listener
Listener to handle events raised by this calibrator. -
estimatedHardIron
private double[] estimatedHardIronEstimated magnetometer hard-iron biases for each magnetometer axis expressed in Teslas (T). -
estimatedMm
private com.irurueta.algebra.Matrix estimatedMmEstimated magnetometer soft-iron matrix containing scale factors and cross coupling errors. This is the product of matrix Tm containing cross coupling errors and Km containing scaling factors. So tat:Mm = [sx mxy mxz] = Tm*Km [myx sy myz] [mzx mzy sz ]Where:Km = [sx 0 0 ] [0 sy 0 ] [0 0 sz]andTm = [1 -alphaXy alphaXz ] [alphaYx 1 -alphaYz] [-alphaZx alphaZy 1 ]Hence:Mm = [sx mxy mxz] = Tm*Km = [sx -sy * alphaXy sz * alphaXz ] [myx sy myz] [sx * alphaYx sy -sz * alphaYz] [mzx mzy sz ] [-sx * alphaZx sy * alphaZy sz ]This instance allows any 3x3 matrix however, typically alphaYx, alphaZx and alphaZy are considered to be zero if the accelerometer z-axis is assumed to be the same as the body z-axis. When this is assumed, myx = mzx = mzy = 0 and the Mm matrix becomes upper diagonal:Mm = [sx mxy mxz] [0 sy myz] [0 0 sz ]Values of this matrix are unit-less. -
estimatedCovariance
private com.irurueta.algebra.Matrix estimatedCovarianceEstimated covariance matrix for estimated parameters. -
estimatedChiSq
private double estimatedChiSqEstimated chi square value. -
estimatedChiSqDegreesOfFreedom
private int estimatedChiSqDegreesOfFreedomEstimated degrees of freedom of chi square value. Degrees of freedom is equal to the number of sampled data minus the number of estimated parameters. -
estimatedReducedChiSq
private double estimatedReducedChiSqEstimated reduced chi square value. This is equal to estimated chi square value divided by its degrees of freedom. Ideally this value should be close to 1.0. -
estimatedMse
private double estimatedMseEstimated mean square error respect to provided measurements. -
estimatedP
private double estimatedPEstimated probability of finding a smaller chi square value expressed as a value between 0.0 and 1.0. The smaller the found chi square value is, the better the fit of the estimated parameters to the actual parameter. Thus, the smaller the chance of finding a smaller chi square value, then the better the estimated fit is. -
estimatedQ
private double estimatedQEstimated measure of quality of estimated fit as a value between 0.0 and 1.0. The larger the quality value is, the better the fit that has been estimated. -
running
private boolean runningIndicates whether calibrator is running. -
magneticModel
Contains Earth's magnetic model.
-
-
Constructor Details
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator()Constructor. -
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.- Parameters:
initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.- Parameters:
initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double initialHardIronX, double initialHardIronY, double initialHardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIronX- initial x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronY- initial y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(double[] initialHardIron) Constructor.- Parameters:
initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron array does not have length 3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] initialHardIron) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron array does not have length 3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double[] initialHardIron) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron array does not have length 3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] initialHardIron) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron array does not have length 3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron) Constructor.- Parameters:
initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
initialHardIron- initial hard-iron to find a solution.initialMm- initial soft-iron matrix containing scale factors and cross coupling errors.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1 or if soft-iron matrix is not 3x3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).initialHardIron- initial hard-iron to find a solution.initialMm- initial soft-iron matrix containing scale factors and cross coupling errors.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1 or if soft-iron matrix is not 3x3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.initialMm- initial soft-iron matrix containing scale factors and cross coupling errors.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1 or if soft-iron matrix is not 3x3.
-
KnownFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix initialHardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
measurements- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).commonAxisUsed- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.initialHardIron- initial hard-iron to find a solution.initialMm- initial soft-iron matrix containing scale factors and cross coupling errors.- Throws:
IllegalArgumentException- if provided hard-iron matrix is not 3x1 or if soft-iron matrix is not 3x3.
-
-
Method Details
-
getInitialHardIronX
public double getInitialHardIronX()Gets initial x-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in Teslas (T).- Specified by:
getInitialHardIronXin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial x-coordinate of magnetometer hard-iron bias.
-
setInitialHardIronX
public void setInitialHardIronX(double initialHardIronX) throws com.irurueta.navigation.LockedException Sets initial x-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in Teslas (T).- Specified by:
setInitialHardIronXin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronX- initial x-coordinate of magnetometer hard-iron bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronY
public double getInitialHardIronY()Gets initial y-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in Teslas (T).- Specified by:
getInitialHardIronYin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial y-coordinate of magnetometer hard-iron bias.
-
setInitialHardIronY
public void setInitialHardIronY(double initialHardIronY) throws com.irurueta.navigation.LockedException Sets initial y-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in Teslas (T).- Specified by:
setInitialHardIronYin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronY- initial y-coordinate of magnetometer hard-iron bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronZ
public double getInitialHardIronZ()Gets initial z-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in Teslas (T).- Specified by:
getInitialHardIronZin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial z-coordinate of magnetometer hard-iron bias.
-
setInitialHardIronZ
public void setInitialHardIronZ(double initialHardIronZ) throws com.irurueta.navigation.LockedException Sets initial z-coordinate of magnetometer hard-iron bias to be used to find a solution. This is expressed in meters Teslas (T).- Specified by:
setInitialHardIronZin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronXAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getInitialHardIronXAsMagneticFluxDensity()Gets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronXAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial x-coordinate of magnetometer hard-iron bias.
-
getInitialHardIronXAsMagneticFluxDensity
public void getInitialHardIronXAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronXAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
result- instance where result will be stored.
-
setInitialHardIronX
public void setInitialHardIronX(com.irurueta.units.MagneticFluxDensity initialHardIronX) throws com.irurueta.navigation.LockedException Sets initial x-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
setInitialHardIronXin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronX- initial x-coordinate of magnetometer bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronYAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getInitialHardIronYAsMagneticFluxDensity()Gets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronYAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial y-coordinate of magnetometer hard-iron bias.
-
getInitialHardIronYAsMagneticFluxDensity
public void getInitialHardIronYAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronYAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
result- instance where result will be stored.
-
setInitialHardIronY
public void setInitialHardIronY(com.irurueta.units.MagneticFluxDensity initialHardIronY) throws com.irurueta.navigation.LockedException Sets initial y-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
setInitialHardIronYin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronY- initial y-coordinate of magnetometer bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronZAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getInitialHardIronZAsMagneticFluxDensity()Gets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronZAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial z-coordinate of magnetometer hard-iron bias.
-
getInitialHardIronZAsMagneticFluxDensity
public void getInitialHardIronZAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
getInitialHardIronZAsMagneticFluxDensityin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
result- instance where result will be stored.
-
setInitialHardIronZ
public void setInitialHardIronZ(com.irurueta.units.MagneticFluxDensity initialHardIronZ) throws com.irurueta.navigation.LockedException Sets initial z-coordinate of magnetometer hard iron bias to be used to find a solution.- Specified by:
setInitialHardIronZin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronZ- initial z-coordinate of magnetometer bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
setInitialHardIron
public void setInitialHardIron(double initialHardIronX, double initialHardIronY, double initialHardIronZ) throws com.irurueta.navigation.LockedException Sets initial hard-iron bias coordinates of magnetometer used to find a solution expressed in Teslas (T).- Specified by:
setInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronX- initial x-coordinate of magnetometer hard-iron bias.initialHardIronY- initial y-coordinate of magnetometer hard-iron bias.initialHardIronZ- initial z-coordinate of magnetometer hard-iron bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
setInitialHardIron
public void setInitialHardIron(com.irurueta.units.MagneticFluxDensity initialHardIronX, com.irurueta.units.MagneticFluxDensity initialHardIronY, com.irurueta.units.MagneticFluxDensity initialHardIronZ) throws com.irurueta.navigation.LockedException Sets initial hard iron coordinates of magnetometer used to find a solution.- Specified by:
setInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIronX- initial x-coordinate of magnetometer bias.initialHardIronY- initial y-coordinate of magnetometer bias.initialHardIronZ- initial z-coordinate of magnetometer bias.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIronAsTriad
Gets initial hard-iron used to find a solution.- Specified by:
getInitialHardIronAsTriadin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial hard-iron.
-
getInitialSx
public double getInitialSx()Gets initial x scaling factor.- Specified by:
getInitialSxin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial x scaling factor.
-
setInitialSx
public void setInitialSx(double initialSx) throws com.irurueta.navigation.LockedException Sets initial x scaling factor.- Specified by:
setInitialSxin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialSx- initial x scaling factor.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialSy
public double getInitialSy()Gets initial y scaling factor.- Specified by:
getInitialSyin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial y scaling factor.
-
setInitialSy
public void setInitialSy(double initialSy) throws com.irurueta.navigation.LockedException Sets initial y scaling factor.- Specified by:
setInitialSyin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialSy- initial y scaling factor.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialSz
public double getInitialSz()Gets initial z scaling factor.- Specified by:
getInitialSzin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial z scaling factor.
-
setInitialSz
public void setInitialSz(double initialSz) throws com.irurueta.navigation.LockedException Sets initial z scaling factor.- Specified by:
setInitialSzin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialSz- initial z scaling factor.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMxy
public double getInitialMxy()Gets initial x-y cross coupling error.- Specified by:
getInitialMxyin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial x-y cross coupling error.
-
setInitialMxy
public void setInitialMxy(double initialMxy) throws com.irurueta.navigation.LockedException Sets initial x-y cross coupling error.- Specified by:
setInitialMxyin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMxy- initial x-y cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMxz
public double getInitialMxz()Gets initial x-z cross coupling error.- Specified by:
getInitialMxzin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial x-z cross coupling error.
-
setInitialMxz
public void setInitialMxz(double initialMxz) throws com.irurueta.navigation.LockedException Sets initial x-z cross coupling error.- Specified by:
setInitialMxzin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMxz- initial x-z cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMyx
public double getInitialMyx()Gets initial y-x cross coupling error.- Specified by:
getInitialMyxin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial y-x cross coupling error.
-
setInitialMyx
public void setInitialMyx(double initialMyx) throws com.irurueta.navigation.LockedException Sets initial y-x cross coupling error.- Specified by:
setInitialMyxin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMyx- initial y-x cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMyz
public double getInitialMyz()Gets initial y-z cross coupling error.- Specified by:
getInitialMyzin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial y-z cross coupling error.
-
setInitialMyz
public void setInitialMyz(double initialMyz) throws com.irurueta.navigation.LockedException Sets initial y-z cross coupling error.- Specified by:
setInitialMyzin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMyz- initial y-z cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMzx
public double getInitialMzx()Gets initial z-x cross coupling error.- Specified by:
getInitialMzxin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial z-x cross coupling error.
-
setInitialMzx
public void setInitialMzx(double initialMzx) throws com.irurueta.navigation.LockedException Sets initial z-x cross coupling error.- Specified by:
setInitialMzxin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMzx- initial z-x cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialMzy
public double getInitialMzy()Gets initial z-y cross coupling error.- Specified by:
getInitialMzyin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial z-y cross coupling error.
-
setInitialMzy
public void setInitialMzy(double initialMzy) throws com.irurueta.navigation.LockedException Sets initial z-y cross coupling error.- Specified by:
setInitialMzyin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMzy- initial z-y cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
setInitialScalingFactors
public void setInitialScalingFactors(double initialSx, double initialSy, double initialSz) throws com.irurueta.navigation.LockedException Sets initial scaling factors.- Specified by:
setInitialScalingFactorsin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
setInitialCrossCouplingErrors
public void setInitialCrossCouplingErrors(double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) throws com.irurueta.navigation.LockedException Sets initial cross coupling errors.- Specified by:
setInitialCrossCouplingErrorsin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
setInitialScalingFactorsAndCrossCouplingErrors
public void setInitialScalingFactorsAndCrossCouplingErrors(double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) throws com.irurueta.navigation.LockedException Sets initial scaling factors and cross coupling errors.- Specified by:
setInitialScalingFactorsAndCrossCouplingErrorsin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialSx- initial x scaling factor.initialSy- initial y scaling factor.initialSz- initial z scaling factor.initialMxy- initial x-y cross coupling error.initialMxz- initial x-z cross coupling error.initialMyx- initial y-x cross coupling error.initialMyz- initial y-z cross coupling error.initialMzx- initial z-x cross coupling error.initialMzy- initial z-y cross coupling error.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getInitialHardIron
public double[] getInitialHardIron()Gets initial hard-iron bias to be used to find a solution as an array. Array values are expressed in Teslas (T).- Specified by:
getInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- array containing coordinates of initial bias.
-
getInitialHardIron
public void getInitialHardIron(double[] result) Gets initial hard-iron bias to be used to find a solution as an array. Array values are expressed in Teslas (T).- Specified by:
getInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
result- instance where result data will be copied to.- Throws:
IllegalArgumentException- if provided array does not have length 3.
-
setInitialHardIron
public void setInitialHardIron(double[] initialHardIron) throws com.irurueta.navigation.LockedException Sets initial hard-iron bias to be used to find a solution as an array. Array values are expressed in Teslas (T).- Specified by:
setInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIron- initial hard-iron to find a solution.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.IllegalArgumentException- if provided array does not have length 3.
-
getInitialHardIronAsMatrix
public com.irurueta.algebra.Matrix getInitialHardIronAsMatrix()Gets initial hard-iron bias to be used to find a solution as a column matrix. Values are expressed in Teslas (T).- Specified by:
getInitialHardIronAsMatrixin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Returns:
- initial hard-iron bias to be used to find a solution as a column matrix.
-
getInitialHardIronAsMatrix
public void getInitialHardIronAsMatrix(com.irurueta.algebra.Matrix result) Gets initial hard-iron bias to be used to find a solution as a column matrix. Values are expressed in Teslas (T).- Specified by:
getInitialHardIronAsMatrixin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
result- instance where result data will be copied to.- Throws:
IllegalArgumentException- if provided matrix is not 3x1.
-
setInitialHardIron
public void setInitialHardIron(com.irurueta.algebra.Matrix initialHardIron) throws com.irurueta.navigation.LockedException Sets initial hard-iron bias to be used to find a solution as a column matrix with values expressed in Teslas (T).- Specified by:
setInitialHardIronin interfaceUnknownHardIronNonLinearMagnetometerCalibrator- Parameters:
initialHardIron- initial hard-iron bias to find a solution.- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.IllegalArgumentException- if provided matrix is not 3x1.
-
getInitialMm
public com.irurueta.algebra.Matrix getInitialMm()Gets initial scale factors and cross coupling errors matrix.- Specified by:
getInitialMmin interfaceMagnetometerNonLinearCalibrator- Returns:
- initial scale factors and cross coupling errors matrix.
-
getInitialMm
public void getInitialMm(com.irurueta.algebra.Matrix result) Gets initial scale factors and cross coupling errors matrix.- Specified by:
getInitialMmin interfaceMagnetometerNonLinearCalibrator- Parameters:
result- instance where data will be stored.- Throws:
IllegalArgumentException- if provided matrix is not 3x3.
-
setInitialMm
public void setInitialMm(com.irurueta.algebra.Matrix initialMm) throws com.irurueta.navigation.LockedException Sets initial scale factors and cross coupling errors matrix.- Specified by:
setInitialMmin interfaceMagnetometerNonLinearCalibrator- Parameters:
initialMm- initial scale factors and cross coupling errors matrix.- Throws:
IllegalArgumentException- if provided matrix is not 3x3.com.irurueta.navigation.LockedException- if calibrator is currently running.
-
getMeasurements
Gets a collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities). If a single device IMU needs to be calibrated, typically all measurements are taken at the same position, with zero velocity and multiple orientations. However, if we just want to calibrate a given IMU model (e.g. obtain an average and less precise calibration for the IMU of a given phone model), we could take measurements collected throughout the planet at multiple positions while the phone remains static (e.g. while charging), hence each measurement position will change, velocity will remain zero and orientation will be typically constant at horizontal orientation while the phone remains on a flat surface.- Specified by:
getMeasurementsin interfaceKnownFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Specified by:
getMeasurementsin interfaceUnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator- Returns:
- a collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities).
-
setMeasurements
public void setMeasurements(Collection<? extends StandardDeviationFrameBodyMagneticFluxDensity> measurements) throws com.irurueta.navigation.LockedException Sets a collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities). If a single device IMU needs to be calibrated, typically all measurements are taken at the same position, with zero velocity and multiple orientations. However, if we just want to calibrate the a given IMU model (e.g. obtain an average and less precise calibration for the IMU of a given phone model), we could take measurements collected throughout the planet at multiple positions while the phone remains static (e.g. while charging), hence each measurement position will change, velocity will remain zero and orientation will be typically constant at horizontal orientation while the phone remains on a flat surface.- Specified by:
setMeasurementsin interfaceKnownFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Specified by:
setMeasurementsin interfaceUnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator- Parameters:
measurements- collection of body magnetic flux density measurements taken at different frames (positions, orientations and velocities).- Throws:
com.irurueta.navigation.LockedException- if estimator is currently running.
-
getMeasurementType
Indicates the type of measurement used by this calibrator.- Specified by:
getMeasurementTypein interfaceMagnetometerCalibrator- Returns:
- type of measurement used by this calibrator.
-
isOrderedMeasurementsRequired
public boolean isOrderedMeasurementsRequired()Indicates whether this calibrator requires ordered measurements in a list or not.- Specified by:
isOrderedMeasurementsRequiredin interfaceMagnetometerCalibrator- Returns:
- true if measurements must be ordered, false otherwise.
-
isQualityScoresRequired
public boolean isQualityScoresRequired()Indicates whether this calibrator requires quality scores for each measurement or not.- Specified by:
isQualityScoresRequiredin interfaceMagnetometerCalibrator- Returns:
- true if quality scores are required, false otherwise.
-
isCommonAxisUsed
public boolean isCommonAxisUsed()Indicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer. When enabled, this eliminates 3 variables from Mm (soft-iron) matrix.- Specified by:
isCommonAxisUsedin interfaceMagnetometerCalibrator- Returns:
- true if z-axis is assumed to be common for accelerometer, gyroscope and magnetometer, false otherwise.
-
setCommonAxisUsed
public void setCommonAxisUsed(boolean commonAxisUsed) throws com.irurueta.navigation.LockedException Specifies whether z-axis is assumed to be common for accelerometer and gyroscope. When enabled, this eliminates 3 variables from Mm matrix.- Specified by:
setCommonAxisUsedin interfaceMagnetometerCalibrator- Parameters:
commonAxisUsed- true if z-axis is assumed to be common for accelerometer, gyroscope and magnetometer, false otherwise.- Throws:
com.irurueta.navigation.LockedException- if estimator is currently running.
-
getListener
Gets listener to handle events raised by this calibrator.- Specified by:
getListenerin interfaceKnownFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,KnownFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Returns:
- listener to handle events raised by this calibrator.
-
getMinimumRequiredMeasurements
public int getMinimumRequiredMeasurements()Gets minimum number of required measurements.- Specified by:
getMinimumRequiredMeasurementsin interfaceMagnetometerCalibrator- Returns:
- minimum number of required measurements.
-
isReady
public boolean isReady()Indicates whether calibrator is ready to start the estimator.- Specified by:
isReadyin interfaceMagnetometerCalibrator- Returns:
- true if calibrator is ready, false otherwise.
-
isRunning
public boolean isRunning()Indicates whether calibrator is currently running or no.- Specified by:
isRunningin interfaceMagnetometerCalibrator- Returns:
- true if calibrator is running, false otherwise.
-
getMagneticModel
Gets Earth's magnetic model.- Returns:
- Earth's magnetic model or null if not provided.
-
calibrate
public void calibrate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, CalibrationExceptionEstimates magnetometer calibration parameters containing scale factors and cross-coupling errors.- Specified by:
calibratein interfaceMagnetometerCalibrator- Throws:
com.irurueta.navigation.LockedException- if calibrator is currently running.com.irurueta.navigation.NotReadyException- if calibrator is not ready.CalibrationException- if calibration fails for numerical reasons.
-
getEstimatedHardIron
public double[] getEstimatedHardIron()Gets array containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).- Specified by:
getEstimatedHardIronin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- array containing x,y,z components of estimated magnetometer hard-iron biases.
-
getEstimatedHardIron
public boolean getEstimatedHardIron(double[] result) Gets array containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).- Specified by:
getEstimatedHardIronin interfaceUnknownHardIronMagnetometerCalibrator- Parameters:
result- instance where estimated magnetometer biases will be stored.- Returns:
- true if result instance was updated, false otherwise (when estimation is not yet available).
-
getEstimatedHardIronAsMatrix
public com.irurueta.algebra.Matrix getEstimatedHardIronAsMatrix()Gets column matrix containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).- Specified by:
getEstimatedHardIronAsMatrixin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- column matrix containing x,y,z components of estimated magnetometer hard-iron biases.
-
getEstimatedHardIronAsMatrix
public boolean getEstimatedHardIronAsMatrix(com.irurueta.algebra.Matrix result) throws com.irurueta.algebra.WrongSizeException Gets column matrix containing x,y,z components of estimated magnetometer hard-iron biases expressed in Teslas (T).- Specified by:
getEstimatedHardIronAsMatrixin interfaceUnknownHardIronMagnetometerCalibrator- Parameters:
result- instance where result data will be stored.- Returns:
- true if result was updated, false otherwise.
- Throws:
com.irurueta.algebra.WrongSizeException- if provided result instance has invalid size.
-
getEstimatedHardIronX
Gets x coordinate of estimated magnetometer bias expressed in Teslas (T).- Specified by:
getEstimatedHardIronXin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- x coordinate of estimated magnetometer bias or null if not available.
-
getEstimatedHardIronY
Gets y coordinate of estimated magnetometer bias expressed in Teslas (T).- Specified by:
getEstimatedHardIronYin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- y coordinate of estimated magnetometer bias or null if not available.
-
getEstimatedHardIronZ
Gets z coordinate of estimated magnetometer bias expressed in Teslas (T).- Specified by:
getEstimatedHardIronZin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- z coordinate of estimated magnetometer bias or null if not available.
-
getEstimatedHardIronXAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronXAsMagneticFluxDensity()Gets x coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronXAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- x coordinate of estimated magnetometer bias.
-
getEstimatedHardIronXAsMagneticFluxDensity
public boolean getEstimatedHardIronXAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets x coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronXAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Parameters:
result- instance where result will be stored.- Returns:
- true if estimated magnetometer bias is available, false otherwise.
-
getEstimatedHardIronYAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronYAsMagneticFluxDensity()Gets y coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronYAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- y coordinate of estimated magnetometer bias.
-
getEstimatedHardIronYAsMagneticFluxDensity
public boolean getEstimatedHardIronYAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets y coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronYAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Parameters:
result- instance where result will be stored.- Returns:
- true if estimated magnetometer bias is available, false otherwise.
-
getEstimatedHardIronZAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronZAsMagneticFluxDensity()Gets z coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronZAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- z coordinate of estimated magnetometer bias.
-
getEstimatedHardIronZAsMagneticFluxDensity
public boolean getEstimatedHardIronZAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets z coordinate of estimated magnetometer bias.- Specified by:
getEstimatedHardIronZAsMagneticFluxDensityin interfaceUnknownHardIronMagnetometerCalibrator- Parameters:
result- instance where result will be stored.- Returns:
- true if estimated magnetometer bias is available, false otherwise.
-
getEstimatedHardIronAsTriad
Gets estimated magnetometer bias.- Specified by:
getEstimatedHardIronAsTriadin interfaceUnknownHardIronMagnetometerCalibrator- Returns:
- estimated magnetometer bias or null if not available.
-
getEstimatedMm
public com.irurueta.algebra.Matrix getEstimatedMm()Gets estimated magnetometer soft-iron matrix containing scale factors and cross coupling errors. This is the product of matrix Tm containing cross coupling errors and Km containing scaling factors. So tat:Mm = [sx mxy mxz] = Tm*Km [myx sy myz] [mzx mzy sz ]Where:Km = [sx 0 0 ] [0 sy 0 ] [0 0 sz]andTm = [1 -alphaXy alphaXz ] [alphaYx 1 -alphaYz] [-alphaZx alphaZy 1 ]Hence:Mm = [sx mxy mxz] = Tm*Km = [sx -sy * alphaXy sz * alphaXz ] [myx sy myz] [sx * alphaYx sy -sz * alphaYz] [mzx mzy sz ] [-sx * alphaZx sy * alphaZy sz ]This instance allows any 3x3 matrix however, typically alphaYx, alphaZx and alphaZy are considered to be zero if the accelerometer z-axis is assumed to be the same as the body z-axis. When this is assumed, myx = mzx = mzy = 0 and the Mm matrix becomes upper diagonal:Mm = [sx mxy mxz] [0 sy myz] [0 0 sz ]Values of this matrix are unit-less.- Specified by:
getEstimatedMmin interfaceMagnetometerCalibrator- Returns:
- estimated magnetometer soft-iron scale factors and cross coupling errors, or null if not available.
-
getEstimatedSx
Gets estimated x-axis scale factor.- Specified by:
getEstimatedSxin interfaceMagnetometerCalibrator- Returns:
- estimated x-axis scale factor or null if not available.
-
getEstimatedSy
Gets estimated y-axis scale factor.- Specified by:
getEstimatedSyin interfaceMagnetometerCalibrator- Returns:
- estimated y-axis scale factor or null if not available.
-
getEstimatedSz
Gets estimated z-axis scale factor.- Specified by:
getEstimatedSzin interfaceMagnetometerCalibrator- Returns:
- estimated z-axis scale factor or null if not available.
-
getEstimatedMxy
Gets estimated x-y cross-coupling error.- Specified by:
getEstimatedMxyin interfaceMagnetometerCalibrator- Returns:
- estimated x-y cross-coupling error or null if not available.
-
getEstimatedMxz
Gets estimated x-z cross-coupling error.- Specified by:
getEstimatedMxzin interfaceMagnetometerCalibrator- Returns:
- estimated x-z cross-coupling error or null if not available.
-
getEstimatedMyx
Gets estimated y-x cross-coupling error.- Specified by:
getEstimatedMyxin interfaceMagnetometerCalibrator- Returns:
- estimated y-x cross-coupling error or null if not available.
-
getEstimatedMyz
Gets estimated y-z cross-coupling error.- Specified by:
getEstimatedMyzin interfaceMagnetometerCalibrator- Returns:
- estimated y-z cross-coupling error or null if not available.
-
getEstimatedMzx
Gets estimated z-x cross-coupling error.- Specified by:
getEstimatedMzxin interfaceMagnetometerCalibrator- Returns:
- estimated z-x cross-coupling error or null if not available.
-
getEstimatedMzy
Gets estimated z-y cross-coupling error.- Specified by:
getEstimatedMzyin interfaceMagnetometerCalibrator- Returns:
- estimated z-y cross-coupling error or null if not available.
-
getEstimatedCovariance
public com.irurueta.algebra.Matrix getEstimatedCovariance()Gets estimated covariance matrix for estimated calibration parameters. Diagonal elements of the matrix contains variance for the following parameters (following indicated order): bx, by, bz, sx, sy, sz, mxy, mxz, myx, myz, mzx, mzy.- Specified by:
getEstimatedCovariancein interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated covariance matrix for estimated calibration parameters.
-
getEstimatedChiSq
public double getEstimatedChiSq()Gets estimated chi square value.- Specified by:
getEstimatedChiSqin interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated chi square value.
-
getEstimatedChiSqDegreesOfFreedom
public int getEstimatedChiSqDegreesOfFreedom()Gets estimated chi square degrees of freedom. Degrees of freedom is equal to the number of sampled data minus the number of estimated parameters.- Specified by:
getEstimatedChiSqDegreesOfFreedomin interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated degrees of freedom of chi square value
-
getEstimatedReducedChiSq
public double getEstimatedReducedChiSq()Gets estimated reduced chi square value. This is equal to estimated chi square value divided by its degrees of freedom. Ideally this value should be close to 1.0, indicating that fit is optimal. A value larger than 1.0 indicates that fit is not good or noise has been underestimated, and a value smaller than 1.0 indicates that there is overfitting or noise has been overestimated.- Specified by:
getEstimatedReducedChiSqin interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated reduced chi square value
-
getEstimatedMse
public double getEstimatedMse()Gets estimated mean square error respect to provided measurements.- Specified by:
getEstimatedMsein interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated mean square error respect to provided measurements.
-
getEstimatedP
public double getEstimatedP()Gets estimated probability of finding a smaller chi square value expressed as a value between 0.0 and 1.0. The smaller the found chi square value is, the better the fit of the estimated parameters to the actual parameter. Thus, the smaller the chance of finding a smaller chi square value, then the better the estimated fit is.- Specified by:
getEstimatedPin interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated probability of finding a smaller chi square value.
-
getEstimatedQ
public double getEstimatedQ()Gets estimated measure of quality of estimated fit as a value between 0.0 and 1.0. The larger the quality value is, the better the fit that has been estimated.- Specified by:
getEstimatedQin interfaceMagnetometerNonLinearCalibrator- Returns:
- estimated measure of quality of estimated fit.
-
getEstimatedHardIronXVariance
Gets variance of estimated x coordinate of magnetometer bias expressed in squared Teslas (T^2).- Returns:
- variance of estimated x coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronXStandardDeviation
Gets standard deviation of estimated x coordinate of magnetometer bias expressed in Teslas (T).- Returns:
- standard deviation of estimated x coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronXStandardDeviationAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronXStandardDeviationAsMagneticFluxDensity()Gets standard deviation of estimated x coordinate of magnetometer bias.- Returns:
- standard deviation of estimated x coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronXStandardDeviationAsMagneticFluxDensity
public boolean getEstimatedHardIronXStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated x coordinate of magnetometer bias.- Parameters:
result- instance where result will be stored.- Returns:
- true if standard deviation of estimated x coordinate of magnetometer bias is available, false otherwise.
-
getEstimatedHardIronYVariance
Gets variance of estimated y coordinate of magnetometer bias expressed in squared Teslas (T^2).- Returns:
- variance of estimated y coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronYStandardDeviation
Gets standard deviation of estimated y coordinate of magnetometer bias expressed in Teslas (T).- Returns:
- standard deviation of estimated y coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronYStandardDeviationAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronYStandardDeviationAsMagneticFluxDensity()Gets standard deviation of estimated y coordinate of magnetometer bias.- Returns:
- standard deviation of estimated y coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronYStandardDeviationAsMagneticFluxDensity
public boolean getEstimatedHardIronYStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated y coordinate of magnetometer bias.- Parameters:
result- instance where result will be stored.- Returns:
- true if standard deviation of estimated y coordinate of magnetometer bias is available, false otherwise.
-
getEstimatedHardIronZVariance
Gets variance of estimated z coordinate of magnetometer bias expressed in squared Teslas (T^2).- Returns:
- variance of estimated z coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronZStandardDeviation
Gets standard deviation of estimated z coordinate of magnetometer bias expressed in Teslas (T).- Returns:
- standard deviation of estimated z coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronZStandardDeviationAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronZStandardDeviationAsMagneticFluxDensity()Gets standard deviation of estimated z coordinate of magnetometer bias.- Returns:
- standard deviation of estimated z coordinate of magnetometer bias or null if not available.
-
getEstimatedHardIronZStandardDeviationAsMagneticFluxDensity
public boolean getEstimatedHardIronZStandardDeviationAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets standard deviation of estimated z coordinate of magnetometer bias.- Parameters:
result- instance where result will be stored.- Returns:
- true if standard deviation of estimated z coordinate of magnetometer bias is available, false otherwise.
-
getEstimatedHardIronStandardDeviation
Gets standard deviation of estimated magnetometer bias coordinates.- Returns:
- standard deviation of estimated magnetometer bias coordinates.
-
getEstimatedHardIronStandardDeviationAverage
Gets average of estimated standard deviation of magnetometer bias coordinates expressed in Teslas (T).- Returns:
- average of estimated standard deviation of magnetometer bias coordinates, or null if not available.
-
getEstimatedHardIronStandardDeviationAverageAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronStandardDeviationAverageAsMagneticFluxDensity()Gets average of estimated standard deviation of magnetometer bias coordinates.- Returns:
- average of estimated standard deviation of magnetometer bias coordinates, or null if not available.
-
getEstimatedHardIronStandardDeviationAverageAsMagneticFluxDensity
public boolean getEstimatedHardIronStandardDeviationAverageAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets average of estimated standard deviation of magnetometer bias coordinates.- Parameters:
result- instance where result will be stored.- Returns:
- true if average of estimated standard deviation of magnetometer bias is available, false otherwise.
-
getEstimatedHardIronStandardDeviationNorm
Gets norm of estimated standard deviation of magnetometer bias expressed in Teslas (T).- Returns:
- norm of estimated standard deviation of magnetometer bias or null if not available.
-
getEstimatedHardIronStandardDeviationNormAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getEstimatedHardIronStandardDeviationNormAsMagneticFluxDensity()Gets norm of estimated standard deviation of magnetometer bias.- Returns:
- norm of estimated standard deviation of magnetometer bias or null if not available.
-
getEstimatedHardIronStandardDeviationNormAsMagneticFluxDensity
public boolean getEstimatedHardIronStandardDeviationNormAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets norm of estimated standard deviation of magnetometer bias.- Parameters:
result- instance where result will be stored.- Returns:
- true if norm of estimated standard deviation of magnetometer bias is available, false otherwise.
-
calibrateCommonAxis
private void calibrateCommonAxis() throws com.irurueta.algebra.AlgebraException, com.irurueta.numerical.fitting.FittingException, com.irurueta.numerical.NotReadyException, IOExceptionInternal method to perform calibration when common z-axis is assumed for both the accelerometer and gyroscope.- Throws:
com.irurueta.algebra.AlgebraException- if there are numerical errors.com.irurueta.numerical.fitting.FittingException- if no convergence to solution is found.com.irurueta.numerical.NotReadyException- if fitter is not ready.IOException- if world magnetic model cannot be loaded.
-
calibrateGeneral
private void calibrateGeneral() throws com.irurueta.algebra.AlgebraException, com.irurueta.numerical.fitting.FittingException, com.irurueta.numerical.NotReadyException, IOExceptionInternal method to perform general calibration.- Throws:
com.irurueta.algebra.AlgebraException- if there are numerical errors.com.irurueta.numerical.fitting.FittingException- if no convergence to solution is found.com.irurueta.numerical.NotReadyException- if fitter is not ready.IOException- if world magnetic model cannot be loaded.
-
setInputData
Sets input data into Levenberg-Marquardt fitter.- Throws:
com.irurueta.algebra.WrongSizeException- never happens.IOException- if world magnetic model cannot be loaded.
-
convertMagneticFluxDensity
private static double convertMagneticFluxDensity(double value, com.irurueta.units.MagneticFluxDensityUnit unit) Converts magnetic flux density value and unit to Teslas.- Parameters:
value- magnetic flux density value.unit- unit of magnetic flux density value.- Returns:
- converted value.
-
convertMagneticFluxDensity
private static double convertMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity magneticFluxDensity) Converts magnetic flux density instance to Teslas.- Parameters:
magneticFluxDensity- magnetic flux density instance to be converted.- Returns:
- converted value.
-