Class KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
java.lang.Object
com.irurueta.navigation.inertial.calibration.accelerometer.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
- All Implemented Interfaces:
AccelerometerCalibrator
,KnownBiasAccelerometerCalibrator
,KnownBiasAndFrameAccelerometerCalibrator<FrameBodyKinematics,
,KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener> UnorderedFrameBodyKinematicsAccelerometerCalibrator
public class KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
extends Object
implements KnownBiasAndFrameAccelerometerCalibrator<FrameBodyKinematics,KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener>, UnorderedFrameBodyKinematicsAccelerometerCalibrator
Estimates accelerometer cross couplings and scaling factors.
This estimator assumes that biases are known.
This estimator uses a linear approach to find a minimum least squared error solution.
To use this estimator at least 4 measurements at different known frames must be provided. In other words, accelerometer samples must be obtained at 4 different positions, orientations and velocities (although typically velocities are always zero).
Measured specific force is assumed to follow the model shown below:
fmeas = ba + (I + Ma) * ftrue + wWhere: - fmeas is the measured specific force. This is a 3x1 vector. - ba is accelerometer bias. This is a known 3x1 vector. - I is the 3x3 identity matrix. - Ma is the 3x3 matrix containing cross-couplings and scaling factors. Ideally, on a perfect accelerometer, this should be a 3x3 zero matrix. - ftrue is ground-truth specific force. - w is measurement noise.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
Known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).private double
Known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).private double
Known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).private static final int
Number of unknowns when common z-axis is assumed for both the accelerometer and gyroscope.private boolean
This flag indicates whether z-axis is assumed to be common for accelerometer and gyroscope.static final boolean
Indicates whether by default a common z-axis is assumed for both the accelerometer and gyroscope.private static final int
Number of equations generated for each measurement.private com.irurueta.algebra.Matrix
Estimated accelerometer scale factors and cross coupling errors.private static final int
Number of unknowns for the general case.Listener to handle events raised by this estimator.private Collection<FrameBodyKinematics>
Contains a collection of body kinematics measurements taken at different frames (positions, orientations and velocities).static final int
Required minimum number of measurements.private boolean
Indicates whether estimator is running. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(double biasX, double biasY, double biasZ) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(double biasX, double biasY, double biasZ, boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(double biasX, double biasY, double biasZ, boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(double biasX, double biasY, double biasZ, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor.KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Estimates accelerometer 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
convertAcceleration
(double value, com.irurueta.units.AccelerationUnit unit) Converts acceleration value and unit to meters per squared second.private static double
convertAcceleration
(com.irurueta.units.Acceleration acceleration) Converts acceleration instance to meters per squared second.private void
fillMa
(double sx, double sy, double sz, double mxy, double mxz, double myx, double myz, double mzx, double mzy) Fills scale factor and cross coupling error matrix with estimated values.double[]
getBias()
Gets known accelerometer bias as an array.void
getBias
(double[] result) Gets known accelerometer bias as an array.com.irurueta.algebra.Matrix
Gets known accelerometer bias as a column matrix.void
getBiasAsMatrix
(com.irurueta.algebra.Matrix result) Gets known accelerometer bias as a column matrix.Gets known accelerometer bias.void
getBiasAsTriad
(AccelerationTriad result) Gets known accelerometer bias.double
getBiasX()
Gets known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).com.irurueta.units.Acceleration
Gets known x coordinate of accelerometer bias.void
getBiasXAsAcceleration
(com.irurueta.units.Acceleration result) Gets known x coordinate of accelerometer bias.double
getBiasY()
Gets known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).com.irurueta.units.Acceleration
Gets known y coordinate of accelerometer bias.void
getBiasYAsAcceleration
(com.irurueta.units.Acceleration result) Gets known y coordinate of accelerometer bias.double
getBiasZ()
Gets known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).com.irurueta.units.Acceleration
Gets known z coordinate of accelerometer bias.void
getBiasZAsAcceleration
(com.irurueta.units.Acceleration result) Gets known z coordinate of accelerometer bias.com.irurueta.algebra.Matrix
Gets estimated accelerometer scale factors and ross coupling errors.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.Gets listener to handle events raised by this estimator.Gets a collection of body kinematics 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 and gyroscope.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 estimator is ready to start the estimator.boolean
Indicates whether estimator is currently running or not.void
setBias
(double[] bias) Sets known accelerometer bias as an array.void
setBias
(com.irurueta.algebra.Matrix bias) Sets known accelerometer bias as a column matrix.void
setBias
(AccelerationTriad bias) Sets known accelerometer bias.void
setBiasCoordinates
(double biasX, double biasY, double biasZ) Sets known accelerometer bias coordinates expressed in meters per squared second (m/s^2).void
setBiasCoordinates
(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) Sets known accelerometer bias coordinates.void
setBiasX
(double biasX) Sets known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).void
setBiasX
(com.irurueta.units.Acceleration biasX) Sets known x coordinate of accelerometer bias.void
setBiasY
(double biasY) Sets known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).void
setBiasY
(com.irurueta.units.Acceleration biasY) Sets known y coordinate of accelerometer bias.void
setBiasZ
(double biasZ) Sets known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).void
setBiasZ
(com.irurueta.units.Acceleration biasZ) Sets known z coordinate of accelerometer bias.void
setCommonAxisUsed
(boolean commonAxisUsed) Specifies whether z-axis is assumed to be common for accelerometer and gyroscope.void
Sets listener to handle events raised by this estimator.void
setMeasurements
(Collection<? extends FrameBodyKinematics> measurements) Sets a collection of body kinematics 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 both the accelerometer and gyroscope.- See Also:
-
MINIMUM_MEASUREMENTS
public static final int MINIMUM_MEASUREMENTSRequired minimum number of measurements.- See Also:
-
EQUATIONS_PER_MEASUREMENT
private static final int EQUATIONS_PER_MEASUREMENTNumber of equations generated for each measurement.- See Also:
-
COMMON_Z_AXIS_UNKNOWNS
private static final int COMMON_Z_AXIS_UNKNOWNSNumber of unknowns when common z-axis is assumed for both the accelerometer and gyroscope.- See Also:
-
GENERAL_UNKNOWNS
private static final int GENERAL_UNKNOWNSNumber of unknowns for the general case.- See Also:
-
measurements
Contains a collection of body kinematics 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. -
commonAxisUsed
private boolean commonAxisUsedThis flag indicates whether z-axis is assumed to be common for accelerometer and gyroscope. When enabled, this eliminates 3 variables from Ma matrix. -
listener
Listener to handle events raised by this estimator. -
biasX
private double biasXKnown x coordinate of accelerometer bias expressed in meters per squared second (m/s^2). -
biasY
private double biasYKnown y coordinate of accelerometer bias expressed in meters per squared second (m/s^2). -
biasZ
private double biasZKnown z coordinate of accelerometer bias expressed in meters per squared second (m/s^2). -
estimatedMa
private com.irurueta.algebra.Matrix estimatedMaEstimated accelerometer scale factors and cross coupling errors. This is the product of matrix Ta containing cross coupling errors and Ka containing scaling factors. So tat:Ma = [sx mxy mxz] = Ta*Ka [myx sy myz] [mzx mzy sz ]
Where:Ka = [sx 0 0 ] [0 sy 0 ] [0 0 sz]
andTa = [1 -alphaXy alphaXz ] [alphaYx 1 -alphaYz] [-alphaZx alphaZy 1 ]
Hence:Ma = [sx mxy mxz] = Ta*Ka = [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 Ma matrix becomes upper diagonal:Ma = [sx mxy mxz] [0 sy myz] [0 0 sz ]
Values of this matrix are unit-less. -
running
private boolean runningIndicates whether estimator is running.
-
-
Constructor Details
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator()Constructor. -
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(boolean commonAxisUsed) Constructor.- Parameters:
commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, boolean commonAxisUsed) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ) Constructor.- Parameters:
biasX
- known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasY
- known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasZ
- known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).biasX
- known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasY
- known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasZ
- known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ, boolean commonAxisUsed) Constructor.- Parameters:
biasX
- known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasY
- known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasZ
- known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, boolean commonAxisUsed) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).biasX
- known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasY
- known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).biasZ
- known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) Constructor.- Parameters:
biasX
- known x coordinate of accelerometer bias.biasY
- known y coordinate of accelerometer bias.biasZ
- known z coordinate of accelerometer bias.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).biasX
- known x coordinate of accelerometer bias.biasY
- known y coordinate of accelerometer bias.biasZ
- known z coordinate of accelerometer bias.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed) Constructor.- Parameters:
biasX
- known x coordinate of accelerometer bias.biasY
- known y coordinate of accelerometer bias.biasZ
- known z coordinate of accelerometer bias.commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator
public KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ, boolean commonAxisUsed) Constructor.- Parameters:
measurements
- collection of body kinematics measurements taken at different frames (positions, orientations and velocities).biasX
- known x coordinate of accelerometer bias.biasY
- known y coordinate of accelerometer bias.biasZ
- known z coordinate of accelerometer bias.commonAxisUsed
- indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
-
-
Method Details
-
getMeasurements
Gets a collection of body kinematics 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:
getMeasurements
in interfaceKnownBiasAndFrameAccelerometerCalibrator<FrameBodyKinematics,
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener> - Specified by:
getMeasurements
in interfaceUnorderedFrameBodyKinematicsAccelerometerCalibrator
- Returns:
- a collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
-
setMeasurements
public void setMeasurements(Collection<? extends FrameBodyKinematics> measurements) throws com.irurueta.navigation.LockedException Sets a collection of body kinematics 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 interfaceKnownBiasAndFrameAccelerometerCalibrator<FrameBodyKinematics,
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener> - Specified by:
setMeasurements
in interfaceUnorderedFrameBodyKinematicsAccelerometerCalibrator
- Parameters:
measurements
- collection of body kinematics 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 interfaceAccelerometerCalibrator
- 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 interfaceAccelerometerCalibrator
- 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 interfaceAccelerometerCalibrator
- Returns:
- true if quality scores are required, false otherwise.
-
isCommonAxisUsed
public boolean isCommonAxisUsed()Indicates whether z-axis is assumed to be common for accelerometer and gyroscope. When enabled, this eliminates 3 variables from Ma matrix.- Specified by:
isCommonAxisUsed
in interfaceAccelerometerCalibrator
- Returns:
- true if z-axis is assumed to be common for accelerometer and gyroscope, 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 Ma matrix.- Specified by:
setCommonAxisUsed
in interfaceAccelerometerCalibrator
- Parameters:
commonAxisUsed
- true if z-axis is assumed to be common for accelerometer and gyroscope, false otherwise.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getListener
Gets listener to handle events raised by this estimator.- Specified by:
getListener
in interfaceKnownBiasAndFrameAccelerometerCalibrator<FrameBodyKinematics,
KnownBiasAndFrameAccelerometerLinearLeastSquaresCalibratorListener> - Returns:
- listener to handle events raised by this estimator.
-
getBiasX
public double getBiasX()Gets known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
getBiasX
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- x coordinate of accelerometer bias.
-
setBiasX
public void setBiasX(double biasX) throws com.irurueta.navigation.LockedException Sets known x coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
setBiasX
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasX
- x coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasY
public double getBiasY()Gets known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
getBiasY
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- y coordinate of accelerometer bias.
-
setBiasY
public void setBiasY(double biasY) throws com.irurueta.navigation.LockedException Sets known y coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
setBiasY
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasY
- y coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasZ
public double getBiasZ()Gets known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
getBiasZ
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- z coordinate of accelerometer bias.
-
setBiasZ
public void setBiasZ(double biasZ) throws com.irurueta.navigation.LockedException Sets known z coordinate of accelerometer bias expressed in meters per squared second (m/s^2).- Specified by:
setBiasZ
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasZ
- z coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasXAsAcceleration
public com.irurueta.units.Acceleration getBiasXAsAcceleration()Gets known x coordinate of accelerometer bias.- Specified by:
getBiasXAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- x coordinate of accelerometer bias.
-
getBiasXAsAcceleration
public void getBiasXAsAcceleration(com.irurueta.units.Acceleration result) Gets known x coordinate of accelerometer bias.- Specified by:
getBiasXAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
result
- instance where result data will be stored.
-
setBiasX
public void setBiasX(com.irurueta.units.Acceleration biasX) throws com.irurueta.navigation.LockedException Sets known x coordinate of accelerometer bias.- Specified by:
setBiasX
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasX
- x coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasYAsAcceleration
public com.irurueta.units.Acceleration getBiasYAsAcceleration()Gets known y coordinate of accelerometer bias.- Specified by:
getBiasYAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- y coordinate of accelerometer bias.
-
getBiasYAsAcceleration
public void getBiasYAsAcceleration(com.irurueta.units.Acceleration result) Gets known y coordinate of accelerometer bias.- Specified by:
getBiasYAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
result
- instance where result data will be stored.
-
setBiasY
public void setBiasY(com.irurueta.units.Acceleration biasY) throws com.irurueta.navigation.LockedException Sets known y coordinate of accelerometer bias.- Specified by:
setBiasY
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasY
- y coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasZAsAcceleration
public com.irurueta.units.Acceleration getBiasZAsAcceleration()Gets known z coordinate of accelerometer bias.- Specified by:
getBiasZAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- z coordinate of accelerometer bias.
-
getBiasZAsAcceleration
public void getBiasZAsAcceleration(com.irurueta.units.Acceleration result) Gets known z coordinate of accelerometer bias.- Specified by:
getBiasZAsAcceleration
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
result
- instance where result data will be stored.
-
setBiasZ
public void setBiasZ(com.irurueta.units.Acceleration biasZ) throws com.irurueta.navigation.LockedException Sets known z coordinate of accelerometer bias.- Specified by:
setBiasZ
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasZ
- z coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
setBiasCoordinates
public void setBiasCoordinates(double biasX, double biasY, double biasZ) throws com.irurueta.navigation.LockedException Sets known accelerometer bias coordinates expressed in meters per squared second (m/s^2).- Specified by:
setBiasCoordinates
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasX
- x coordinate of accelerometer bias.biasY
- y coordinate of accelerometer bias.biasZ
- z coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
setBiasCoordinates
public void setBiasCoordinates(com.irurueta.units.Acceleration biasX, com.irurueta.units.Acceleration biasY, com.irurueta.units.Acceleration biasZ) throws com.irurueta.navigation.LockedException Sets known accelerometer bias coordinates.- Specified by:
setBiasCoordinates
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
biasX
- z coordinate of accelerometer bias.biasY
- y coordinate of accelerometer bias.biasZ
- z coordinate of accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.
-
getBiasAsTriad
Gets known accelerometer bias.- Specified by:
getBiasAsTriad
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- known accelerometer bias.
-
getBias
public double[] getBias()Gets known accelerometer bias as an array. Array values are expressed in meters per squared second (m/s^2).- Specified by:
getBias
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- array containing coordinates of known bias.
-
getBias
public void getBias(double[] result) Gets known accelerometer bias as an array. Array values are expressed in meters per squared second (m/s^2).- Specified by:
getBias
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
result
- instance where result data will be copied to.- Throws:
IllegalArgumentException
- if provided array does not have length 3.
-
setBias
public void setBias(double[] bias) throws com.irurueta.navigation.LockedException Sets known accelerometer bias as an array. Array values are expressed in meters per squared second (m/s^2).- Specified by:
setBias
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
bias
- known accelerometer bias.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently running.IllegalArgumentException
- if provided array does not have length 3.
-
getBiasAsMatrix
public com.irurueta.algebra.Matrix getBiasAsMatrix()Gets known accelerometer bias as a column matrix.- Specified by:
getBiasAsMatrix
in interfaceKnownBiasAccelerometerCalibrator
- Returns:
- known accelerometer bias as a column matrix.
-
getBiasAsMatrix
public void getBiasAsMatrix(com.irurueta.algebra.Matrix result) Gets known accelerometer bias as a column matrix.- Specified by:
getBiasAsMatrix
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
result
- instance where result data will be copied to.- Throws:
IllegalArgumentException
- if provided matrix is not 3x1.
-
setBias
public void setBias(com.irurueta.algebra.Matrix bias) throws com.irurueta.navigation.LockedException Sets known accelerometer bias as a column matrix.- Specified by:
setBias
in interfaceKnownBiasAccelerometerCalibrator
- Parameters:
bias
- accelerometer bias to be set.- Throws:
com.irurueta.navigation.LockedException
- if calibrator is currently runningIllegalArgumentException
- if provided matrix is not 3x1.
-
getMinimumRequiredMeasurements
public int getMinimumRequiredMeasurements()Gets minimum number of required measurements.- Specified by:
getMinimumRequiredMeasurements
in interfaceAccelerometerCalibrator
- Returns:
- minimum number of required measurements.
-
isReady
public boolean isReady()Indicates whether estimator is ready to start the estimator.- Specified by:
isReady
in interfaceAccelerometerCalibrator
- Returns:
- true if estimator is ready, false otherwise.
-
isRunning
public boolean isRunning()Indicates whether estimator is currently running or not.- Specified by:
isRunning
in interfaceAccelerometerCalibrator
- Returns:
- true if estimator is running, false otherwise.
-
calibrate
public void calibrate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, CalibrationExceptionEstimates accelerometer calibration parameters containing scale factors and cross-coupling errors.- Specified by:
calibrate
in interfaceAccelerometerCalibrator
- Throws:
com.irurueta.navigation.LockedException
- if estimator is currently running.com.irurueta.navigation.NotReadyException
- if estimator is not ready.CalibrationException
- if estimation fails for numerical reasons.
-
getEstimatedMa
public com.irurueta.algebra.Matrix getEstimatedMa()Gets estimated accelerometer scale factors and ross coupling errors. This is the product of matrix Ta containing cross coupling errors and Ka containing scaling factors. So tat:Ma = [sx mxy mxz] = Ta*Ka [myx sy myz] [mzx mzy sz ]
Where:Ka = [sx 0 0 ] [0 sy 0 ] [0 0 sz]
andTa = [1 -alphaXy alphaXz ] [alphaYx 1 -alphaYz] [-alphaZx alphaZy 1 ]
Hence:Ma = [sx mxy mxz] = Ta*Ka = [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 Ma matrix becomes upper diagonal:Ma = [sx mxy mxz] [0 sy myz] [0 0 sz ]
Values of this matrix are unit-less.- Specified by:
getEstimatedMa
in interfaceAccelerometerCalibrator
- Returns:
- estimated accelerometer scale factors and cross coupling errors, or null if not available.
-
getEstimatedSx
Gets estimated x-axis scale factor.- Specified by:
getEstimatedSx
in interfaceAccelerometerCalibrator
- Returns:
- estimated x-axis scale factor or null if not available.
-
getEstimatedSy
Gets estimated y-axis scale factor.- Specified by:
getEstimatedSy
in interfaceAccelerometerCalibrator
- Returns:
- estimated y-axis scale factor or null if not available.
-
getEstimatedSz
Gets estimated z-axis scale factor.- Specified by:
getEstimatedSz
in interfaceAccelerometerCalibrator
- Returns:
- estimated z-axis scale factor or null if not available.
-
getEstimatedMxy
Gets estimated x-y cross-coupling error.- Specified by:
getEstimatedMxy
in interfaceAccelerometerCalibrator
- Returns:
- estimated x-y cross-coupling error or null if not available.
-
getEstimatedMxz
Gets estimated x-z cross-coupling error.- Specified by:
getEstimatedMxz
in interfaceAccelerometerCalibrator
- Returns:
- estimated x-z cross-coupling error or null if not available.
-
getEstimatedMyx
Gets estimated y-x cross-coupling error.- Specified by:
getEstimatedMyx
in interfaceAccelerometerCalibrator
- Returns:
- estimated y-x cross-coupling error or null if not available.
-
getEstimatedMyz
Gets estimated y-z cross-coupling error.- Specified by:
getEstimatedMyz
in interfaceAccelerometerCalibrator
- Returns:
- estimated y-z cross-coupling error or null if not available.
-
getEstimatedMzx
Gets estimated z-x cross-coupling error.- Specified by:
getEstimatedMzx
in interfaceAccelerometerCalibrator
- Returns:
- estimated z-x cross-coupling error or null if not available.
-
getEstimatedMzy
Gets estimated z-y cross-coupling error.- Specified by:
getEstimatedMzy
in interfaceAccelerometerCalibrator
- Returns:
- estimated z-y cross-coupling error or null if not available.
-
calibrateCommonAxis
private void calibrateCommonAxis() throws com.irurueta.algebra.AlgebraExceptionInternal 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.
-
calibrateGeneral
private void calibrateGeneral() throws com.irurueta.algebra.AlgebraExceptionInternal method to perform general calibration.- Throws:
com.irurueta.algebra.AlgebraException
- if there are numerical errors.
-
fillMa
private void fillMa(double sx, double sy, double sz, double mxy, double mxz, double myx, double myz, double mzx, double mzy) throws com.irurueta.algebra.WrongSizeException Fills scale factor and cross coupling error matrix with estimated values.- Parameters:
sx
- x scale factorsy
- y scale factorsz
- z scale factormxy
- x-y cross couplingmxz
- x-z cross couplingmyx
- y-x cross couplingmyz
- y-z cross couplingmzx
- z-x cross couplingmzy
- z-y cross coupling- Throws:
com.irurueta.algebra.WrongSizeException
- never happens.
-
convertAcceleration
private static double convertAcceleration(double value, com.irurueta.units.AccelerationUnit unit) Converts acceleration value and unit to meters per squared second.- Parameters:
value
- acceleration value.unit
- unit of acceleration value.- Returns:
- converted value.
-
convertAcceleration
private static double convertAcceleration(com.irurueta.units.Acceleration acceleration) Converts acceleration instance to meters per squared second.- Parameters:
acceleration
- acceleration instance to be converted.- Returns:
- converted value.
-