Class KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
java.lang.Object
com.irurueta.navigation.inertial.calibration.magnetometer.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
- All Implemented Interfaces:
KnownHardIronAndFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,
,KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener> KnownHardIronMagnetometerCalibrator
,MagnetometerCalibrator
,MagnetometerNonLinearCalibrator
,UnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator
public class KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
extends Object
implements KnownHardIronAndFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener>, MagnetometerNonLinearCalibrator, UnorderedStandardDeviationFrameBodyMagneticFluxDensityMagnetometerCalibrator
Estimates magnetometer soft-iron 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 3 measurements at different known frames must be provided. In other words, magnetometer samples must be obtained at 3 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 + wWhere: - 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 int
Number of unknowns when common z-axis is assumed for the accelerometer, gyroscope and magnetometer.private boolean
This flag indicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer.static final boolean
Indicates whether by default a common z-axis is assumed for the accelerometer, gyroscope and magnetometer.private double
Estimated chi square value.private com.irurueta.algebra.Matrix
Estimated covariance matrix for estimated parameters.private com.irurueta.algebra.Matrix
Estimated magnetometer soft-iron matrix containing scale factors and cross coupling errors.private double
Estimated mean square error respect to provided measurements.private final com.irurueta.numerical.fitting.LevenbergMarquardtMultiVariateFitter
Levenberg-Marquardt fitter to find a non-linear solution.private static final int
Number of unknowns for the general case.private double
X-coordinate of known hard-iron bias.private double
Y-coordinate of known hard-iron bias.private double
Z-coordinate of known hard-iron bias.private double
Initial x-y cross coupling error.private double
Initial x-z cross coupling error.private double
Initial y-x cross coupling error.private double
Initial y-z cross coupling error.private double
Initial z-x cross coupling error.private double
Initial z-y cross coupling error.private double
Initial x scaling factor.private double
Initial y scaling factor.private double
Initial z scaling factor.Listener to handle events raised by this calibrator.private WorldMagneticModel
Contains 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 int
Required minimum number of measurements.private boolean
Indicates whether calibrator is running. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(boolean commonAxisUsed, WorldMagneticModel magneticModel, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(WorldMagneticModel magneticModel, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, WorldMagneticModel magneticModel, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double[] hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double[] hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, double hardIronX, double hardIronY, double hardIronZ, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, com.irurueta.algebra.Matrix hardIron, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor.KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, WorldMagneticModel magneticModel, KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Estimates magnetometer calibration parameters containing scale factors and cross-coupling errors.private void
Internal method to perform calibration when common z-axis is assumed for both the accelerometer and gyroscope.private void
Internal method to perform general calibration.private static double
convertMagneticFluxDensity
(double value, com.irurueta.units.MagneticFluxDensityUnit unit) Converts magnetic flux density value and unit to Teslas.private static double
convertMagneticFluxDensity
(com.irurueta.units.MagneticFluxDensity magneticFluxDensity) Converts magnetic flux density instance to Teslas.double
Gets estimated chi square value.com.irurueta.algebra.Matrix
Gets estimated covariance matrix for estimated calibration parameters.com.irurueta.algebra.Matrix
Gets estimated magnetometer soft-iron matrix containing scale factors and cross coupling errors.double
Gets 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.Gets estimated x-axis scale factor.Gets estimated y-axis scale factor.Gets estimated z-axis scale factor.double[]
Gets known hard-iron bias as an array.void
getHardIron
(double[] result) Gets known hard-iron bias as an array.Gets known hard-iron.void
Gets known hard-iron.com.irurueta.algebra.Matrix
Gets known hard-iron bias as a column matrix.void
getHardIronMatrix
(com.irurueta.algebra.Matrix result) Gets known hard-iron bias as a column matrix.double
Gets x-coordinate of known magnetometer hard-iron bias.com.irurueta.units.MagneticFluxDensity
Gets known x coordinate of magnetometer hard-iron.void
getHardIronXAsMagneticFluxDensity
(com.irurueta.units.MagneticFluxDensity result) Gets known x coordinate of magnetometer hard-iron.double
Gets y-coordinate of known magnetometer hard-iron bias.com.irurueta.units.MagneticFluxDensity
Gets known y coordinate of magnetometer hard-iron.void
getHardIronYAsMagneticFluxDensity
(com.irurueta.units.MagneticFluxDensity result) Gets known y coordinate of magnetometer hard-iron.double
Gets z-coordinate of known magnetometer hard-iron bias.com.irurueta.units.MagneticFluxDensity
Gets known z coordinate of magnetometer hard-iron.void
getHardIronZAsMagneticFluxDensity
(com.irurueta.units.MagneticFluxDensity result) Gets known z coordinate of magnetometer hard-iron.com.irurueta.algebra.Matrix
Gets initial scale factors and cross coupling errors matrix.void
getInitialMm
(com.irurueta.algebra.Matrix result) Gets initial scale factors and cross coupling errors matrix.double
Gets initial x-y cross coupling error.double
Gets initial x-z cross coupling error.double
Gets initial y-x cross coupling error.double
Gets initial y-z cross coupling error.double
Gets initial z-x cross coupling error.double
Gets initial z-y cross coupling error.double
Gets initial x scaling factor.double
Gets initial y scaling factor.double
Gets 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.int
Gets minimum number of required measurements.boolean
Indicates whether z-axis is assumed to be common for accelerometer, gyroscope and magnetometer.boolean
Indicates whether this calibrator requires ordered measurements in a list or not.boolean
Indicates whether this calibrator requires quality scores for each measurement or not.boolean
isReady()
Indicates whether calibrator is ready to start the estimator.boolean
Indicates whether calibrator is currently running or no.void
setCommonAxisUsed
(boolean commonAxisUsed) Specifies whether z-axis is assumed to be common for accelerometer and gyroscope.void
setHardIron
(double[] hardIron) Sets known hard-iron bias as an array.void
setHardIron
(com.irurueta.algebra.Matrix hardIron) Sets known hard-iron bias.void
setHardIron
(MagneticFluxDensityTriad hardIron) Sets known hard-iron.void
setHardIronCoordinates
(double hardIronX, double hardIronY, double hardIronZ) Sets known hard-iron bias coordinates of magnetometer expressed in Teslas (T).void
setHardIronCoordinates
(com.irurueta.units.MagneticFluxDensity hardIronX, com.irurueta.units.MagneticFluxDensity hardIronY, com.irurueta.units.MagneticFluxDensity hardIronZ) Sets known hard-iron coordinates.void
setHardIronX
(double hardIronX) Sets x-coordinate of known magnetometer hard-iron bias.void
setHardIronX
(com.irurueta.units.MagneticFluxDensity hardIronX) Sets known x-coordinate of magnetometer hard-iron.void
setHardIronY
(double hardIronY) Sets y-coordinate of known magnetometer hard-iron bias.void
setHardIronY
(com.irurueta.units.MagneticFluxDensity hardIronY) Sets known y-coordinate of magnetometer hard-iron.void
setHardIronZ
(double hardIronZ) Sets z-coordinate of known magnetometer hard-iron bias.void
setHardIronZ
(com.irurueta.units.MagneticFluxDensity hardIronZ) Sets known z-coordinate of magnetometer hard-iron.void
setInitialCrossCouplingErrors
(double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Sets initial cross coupling errors.void
setInitialMm
(com.irurueta.algebra.Matrix initialMm) Sets initial scale factors and cross coupling errors matrix.void
setInitialMxy
(double initialMxy) Sets initial x-y cross coupling error.void
setInitialMxz
(double initialMxz) Sets initial x-z cross coupling error.void
setInitialMyx
(double initialMyx) Sets initial y-x cross coupling error.void
setInitialMyz
(double initialMyz) Sets initial y-z cross coupling error.void
setInitialMzx
(double initialMzx) Sets initial z-x cross coupling error.void
setInitialMzy
(double initialMzy) Sets initial z-y cross coupling error.void
setInitialScalingFactors
(double initialSx, double initialSy, double initialSz) Sets initial scaling factors.void
setInitialScalingFactorsAndCrossCouplingErrors
(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.void
setInitialSx
(double initialSx) Sets initial x scaling factor.void
setInitialSy
(double initialSy) Sets initial y scaling factor.void
setInitialSz
(double initialSz) Sets initial z scaling factor.private void
Sets input data into Levenberg-Marquardt fitter.void
Sets listener to handle events raised by this calibrator.void
setMagneticModel
(WorldMagneticModel magneticModel) Sets Earth's magnetic model.void
setMeasurements
(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. -
hardIronX
private double hardIronXX-coordinate of known hard-iron bias. This is expressed in Teslas (T). -
hardIronY
private double hardIronYY-coordinate of known hard-iron bias. This is expressed in Teslas (T). -
hardIronZ
private double hardIronZZ-coordinate of known hard-iron bias. 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. -
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. -
estimatedMse
private double estimatedMseEstimated mean square error respect to provided measurements. -
running
private boolean runningIndicates whether calibrator is running. -
magneticModel
Contains Earth's magnetic model.
-
-
Constructor Details
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator()Constructor. -
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements) Constructor.- Parameters:
measurements
- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(double hardIronX, double hardIronY, double hardIronZ) Constructor.- Parameters:
hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ) Constructor.- Parameters:
measurements
- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ) 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.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- z-coordinate of magnetometer hard-iron bias expressed in Teslas (T).
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, 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).hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, 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.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(double hardIronX, double hardIronY, double hardIronZ, double initialSx, double initialSy, double initialSz, double initialMxy, double initialMxz, double initialMyx, double initialMyz, double initialMzx, double initialMzy) Constructor.- Parameters:
hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double hardIronX, double hardIronY, double hardIronZ, 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).hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, 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.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double hardIronX, double hardIronY, double hardIronZ, 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.hardIronX
- x-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronY
- y-coordinate of magnetometer hard-iron bias expressed in Teslas (T).hardIronZ
- 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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(double[] hardIron) Constructor.- Parameters:
hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron array does not have length 3.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, double[] hardIron) Constructor.- Parameters:
measurements
- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron array does not have length 3.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, double[] hardIron) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron array does not have length 3.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, double[] hardIron) 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.hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron array does not have length 3.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix hardIron) Constructor.- Parameters:
hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron matrix is not 3x1.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron) Constructor.- Parameters:
measurements
- collection of body magnetic flux density measurements with standard deviations taken at different frames (positions and orientations).hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron matrix is not 3x1.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron matrix is not 3x1.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron) 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.hardIron
- known hard-iron.- Throws:
IllegalArgumentException
- if provided hard-iron matrix is not 3x1.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
hardIron
- known hard-iron.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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, com.irurueta.algebra.Matrix hardIron, 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).hardIron
- known hard-iron.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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, com.irurueta.algebra.Matrix initialMm) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for the accelerometer, gyroscope and magnetometer.hardIron
- known hard-iron.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.
-
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator
public KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibrator(Collection<StandardDeviationFrameBodyMagneticFluxDensity> measurements, boolean commonAxisUsed, com.irurueta.algebra.Matrix hardIron, 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.hardIron
- known hard-iron.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
-
getHardIronX
public double getHardIronX()Gets x-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
getHardIronX
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- x-coordinate of known magnetometer hard-iron bias.
-
setHardIronX
public void setHardIronX(double hardIronX) throws com.irurueta.navigation.LockedException Sets x-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
setHardIronX
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronX
- x coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronY
public double getHardIronY()Gets y-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
getHardIronY
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- y-coordinate of known magnetometer hard-iron bias.
-
setHardIronY
public void setHardIronY(double hardIronY) throws com.irurueta.navigation.LockedException Sets y-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
setHardIronY
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronY
- y coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronZ
public double getHardIronZ()Gets z-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
getHardIronZ
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- z-coordinate of known magnetometer hard-iron bias.
-
setHardIronZ
public void setHardIronZ(double hardIronZ) throws com.irurueta.navigation.LockedException Sets z-coordinate of known magnetometer hard-iron bias. This is expressed in Teslas (T).- Specified by:
setHardIronZ
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronZ
- z coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronXAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getHardIronXAsMagneticFluxDensity()Gets known x coordinate of magnetometer hard-iron.- Specified by:
getHardIronXAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- x coordinate of magnetometer hard-iron.
-
getHardIronXAsMagneticFluxDensity
public void getHardIronXAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets known x coordinate of magnetometer hard-iron.- Specified by:
getHardIronXAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
result
- instance where result will be stored.
-
setHardIronX
public void setHardIronX(com.irurueta.units.MagneticFluxDensity hardIronX) throws com.irurueta.navigation.LockedException Sets known x-coordinate of magnetometer hard-iron.- Specified by:
setHardIronX
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronX
- known x-coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronYAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getHardIronYAsMagneticFluxDensity()Gets known y coordinate of magnetometer hard-iron.- Specified by:
getHardIronYAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- y coordinate of magnetometer hard-iron.
-
getHardIronYAsMagneticFluxDensity
public void getHardIronYAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets known y coordinate of magnetometer hard-iron.- Specified by:
getHardIronYAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
result
- instance where result will be stored.
-
setHardIronY
public void setHardIronY(com.irurueta.units.MagneticFluxDensity hardIronY) throws com.irurueta.navigation.LockedException Sets known y-coordinate of magnetometer hard-iron.- Specified by:
setHardIronY
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronY
- known y-coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronZAsMagneticFluxDensity
public com.irurueta.units.MagneticFluxDensity getHardIronZAsMagneticFluxDensity()Gets known z coordinate of magnetometer hard-iron.- Specified by:
getHardIronZAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- z coordinate of magnetometer hard-iron.
-
getHardIronZAsMagneticFluxDensity
public void getHardIronZAsMagneticFluxDensity(com.irurueta.units.MagneticFluxDensity result) Gets known z coordinate of magnetometer hard-iron.- Specified by:
getHardIronZAsMagneticFluxDensity
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
result
- instance where result will be stored.
-
setHardIronZ
public void setHardIronZ(com.irurueta.units.MagneticFluxDensity hardIronZ) throws com.irurueta.navigation.LockedException Sets known z-coordinate of magnetometer hard-iron.- Specified by:
setHardIronZ
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronZ
- known z-coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
setHardIronCoordinates
public void setHardIronCoordinates(double hardIronX, double hardIronY, double hardIronZ) throws com.irurueta.navigation.LockedException Sets known hard-iron bias coordinates of magnetometer expressed in Teslas (T).- Specified by:
setHardIronCoordinates
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronX
- x-coordinate of magnetometer hard-iron.hardIronY
- y-coordinate of magnetometer hard-iron.hardIronZ
- z-coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
setHardIronCoordinates
public void setHardIronCoordinates(com.irurueta.units.MagneticFluxDensity hardIronX, com.irurueta.units.MagneticFluxDensity hardIronY, com.irurueta.units.MagneticFluxDensity hardIronZ) throws com.irurueta.navigation.LockedException Sets known hard-iron coordinates.- Specified by:
setHardIronCoordinates
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIronX
- x-coordinate of magnetometer hard-iron.hardIronY
- y-coordinate of magnetometer hard-iron.hardIronZ
- z-coordinate of magnetometer hard-iron.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.
-
getHardIronAsTriad
Gets known hard-iron.- Specified by:
getHardIronAsTriad
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- known hard-iron.
-
getInitialSx
public double getInitialSx()Gets initial x scaling factor.- Specified by:
getInitialSx
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- initial x scaling factor.
-
setInitialSx
public void setInitialSx(double initialSx) throws com.irurueta.navigation.LockedException Sets initial x scaling factor.- Specified by:
setInitialSx
in 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:
getInitialSy
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- initial y scaling factor.
-
setInitialSy
public void setInitialSy(double initialSy) throws com.irurueta.navigation.LockedException Sets initial y scaling factor.- Specified by:
setInitialSy
in 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:
getInitialSz
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- initial z scaling factor.
-
setInitialSz
public void setInitialSz(double initialSz) throws com.irurueta.navigation.LockedException Sets initial z scaling factor.- Specified by:
setInitialSz
in 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:
getInitialMxy
in 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:
setInitialMxy
in 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:
getInitialMxz
in 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:
setInitialMxz
in 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:
getInitialMyx
in 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:
setInitialMyx
in 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:
getInitialMyz
in 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:
setInitialMyz
in 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:
getInitialMzx
in 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:
setInitialMzx
in 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:
getInitialMzy
in 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:
setInitialMzy
in 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:
setInitialScalingFactors
in 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:
setInitialCrossCouplingErrors
in 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:
setInitialScalingFactorsAndCrossCouplingErrors
in 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.
-
getHardIron
public double[] getHardIron()Gets known hard-iron bias as an array. Array values are expressed in Teslas (T).- Specified by:
getHardIron
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- array containing coordinates of initial bias.
-
getHardIron
public void getHardIron(double[] result) Gets known hard-iron bias as an array. Array values are expressed in Teslas (T).- Specified by:
getHardIron
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
result
- instance where result data will be copied to.- Throws:
IllegalArgumentException
- if provided array does not have length 3.
-
setHardIron
public void setHardIron(double[] hardIron) throws com.irurueta.navigation.LockedException Sets known hard-iron bias as an array. Array values are expressed in Teslas (T).- Specified by:
setHardIron
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIron
- known hard-iron bias.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.IllegalArgumentException
- if provided array does not have length 3.
-
getHardIronMatrix
public com.irurueta.algebra.Matrix getHardIronMatrix()Gets known hard-iron bias as a column matrix.- Specified by:
getHardIronMatrix
in interfaceKnownHardIronMagnetometerCalibrator
- Returns:
- hard-iron bias as a column matrix.
-
getHardIronMatrix
public void getHardIronMatrix(com.irurueta.algebra.Matrix result) Gets known hard-iron bias as a column matrix.- Specified by:
getHardIronMatrix
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
result
- instance where result data will be copied to.- Throws:
IllegalArgumentException
- if provided matrix is not 3x1.
-
setHardIron
public void setHardIron(com.irurueta.algebra.Matrix hardIron) throws com.irurueta.navigation.LockedException Sets known hard-iron bias.- Specified by:
setHardIron
in interfaceKnownHardIronMagnetometerCalibrator
- Parameters:
hardIron
- magnetometer hard-iron bias to be set.- 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:
getInitialMm
in 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:
getInitialMm
in 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:
setInitialMm
in 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:
getMeasurements
in interfaceKnownHardIronAndFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Specified by:
getMeasurements
in 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:
setMeasurements
in interfaceKnownHardIronAndFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Specified by:
setMeasurements
in 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:
getMeasurementType
in 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:
isOrderedMeasurementsRequired
in 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:
isQualityScoresRequired
in 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:
isCommonAxisUsed
in 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:
setCommonAxisUsed
in 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:
getListener
in interfaceKnownHardIronAndFrameMagnetometerCalibrator<StandardDeviationFrameBodyMagneticFluxDensity,
KnownHardIronAndFrameMagnetometerNonLinearLeastSquaresCalibratorListener> - Returns:
- listener to handle events raised by this calibrator.
-
getMinimumRequiredMeasurements
public int getMinimumRequiredMeasurements()Gets minimum number of required measurements.- Specified by:
getMinimumRequiredMeasurements
in interfaceMagnetometerCalibrator
- Returns:
- minimum number of required measurements.
-
isReady
public boolean isReady()Indicates whether calibrator is ready to start the estimator.- Specified by:
isReady
in interfaceMagnetometerCalibrator
- Returns:
- true if calibrator is ready, false otherwise.
-
isRunning
public boolean isRunning()Indicates whether calibrator is currently running or no.- Specified by:
isRunning
in 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:
calibrate
in 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.
-
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:
getEstimatedMm
in 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:
getEstimatedSx
in interfaceMagnetometerCalibrator
- Returns:
- estimated x-axis scale factor or null if not available.
-
getEstimatedSy
Gets estimated y-axis scale factor.- Specified by:
getEstimatedSy
in interfaceMagnetometerCalibrator
- Returns:
- estimated y-axis scale factor or null if not available.
-
getEstimatedSz
Gets estimated z-axis scale factor.- Specified by:
getEstimatedSz
in interfaceMagnetometerCalibrator
- Returns:
- estimated z-axis scale factor or null if not available.
-
getEstimatedMxy
Gets estimated x-y cross-coupling error.- Specified by:
getEstimatedMxy
in interfaceMagnetometerCalibrator
- Returns:
- estimated x-y cross-coupling error or null if not available.
-
getEstimatedMxz
Gets estimated x-z cross-coupling error.- Specified by:
getEstimatedMxz
in interfaceMagnetometerCalibrator
- Returns:
- estimated x-z cross-coupling error or null if not available.
-
getEstimatedMyx
Gets estimated y-x cross-coupling error.- Specified by:
getEstimatedMyx
in interfaceMagnetometerCalibrator
- Returns:
- estimated y-x cross-coupling error or null if not available.
-
getEstimatedMyz
Gets estimated y-z cross-coupling error.- Specified by:
getEstimatedMyz
in interfaceMagnetometerCalibrator
- Returns:
- estimated y-z cross-coupling error or null if not available.
-
getEstimatedMzx
Gets estimated z-x cross-coupling error.- Specified by:
getEstimatedMzx
in interfaceMagnetometerCalibrator
- Returns:
- estimated z-x cross-coupling error or null if not available.
-
getEstimatedMzy
Gets estimated z-y cross-coupling error.- Specified by:
getEstimatedMzy
in 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): sx, sy, sz, mxy, mxz, myx, myz, mzx, mzy.- Specified by:
getEstimatedCovariance
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- estimated covariance matrix for estimated position.
-
getEstimatedChiSq
public double getEstimatedChiSq()Gets estimated chi square value.- Specified by:
getEstimatedChiSq
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- estimated chi square value.
-
getEstimatedMse
public double getEstimatedMse()Gets estimated mean square error respect to provided measurements.- Specified by:
getEstimatedMse
in interfaceMagnetometerNonLinearCalibrator
- Returns:
- estimated mean square error respect to provided measurements.
-
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.
-