Class KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

java.lang.Object
com.irurueta.navigation.inertial.calibration.gyroscope.KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator
All Implemented Interfaces:
GyroscopeCalibrator, KnownBiasAndFrameGyroscopeCalibrator<FrameBodyKinematics,KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener>, KnownBiasGyroscopeCalibrator, UnorderedFrameBodyKinematicsGyroscopeCalibrator

Estimates gyroscope cross couplings and scaling factors along with G-dependent cross biases introduced on the gyroscope by the specific forces sensed by the accelerometer. This estimator assumes that biases are known.

This calibrator uses a linear approach to find a minimum least squared error solution.

To use this calibrator at least 6 measurements at different known frames must be provided. In other words, accelerometer and gyroscope (i.e. body kinematics) samples must be obtained at 6 different positions, orientations and velocities (although typically velocities are always zero).

Measured gyroscope angular rates is assumed to follow the model shown below:

     Ωmeas = bg + (I + Mg) * Ωtrue + Gg * ftrue + w
 
Where: - Ωmeas is the measured gyroscope angular rates. This is a 3x1 vector. - bg is the gyroscope bias. This is a known 3x1 vector. - I is the 3x3 identity matrix. - Mg is the 3x3 matrix containing cross-couplings and scaling factors. Ideally, on a perfect gyroscope, this should be a 3x3 zero matrix. - Ωtrue is ground-truth gyroscope angular rates. - Gg is the G-dependent cross biases introduced by the specific forces sensed by the accelerometer. Ideally, on a perfect gyroscope, this should be a 3x3 zero matrix. - ftrue is ground-truth specific force. This is a 3x1 vector. - w is measurement noise. This is a 3x1 vector.
  • Field Details

    • DEFAULT_USE_COMMON_Z_AXIS

      public static final boolean DEFAULT_USE_COMMON_Z_AXIS
      Indicates whether by default a common z-axis is assumed for both the accelerometer and gyroscope.
      See Also:
    • MINIMUM_MEASUREMENTS

      public static final int MINIMUM_MEASUREMENTS
      Required minimum number of measurements.
      See Also:
    • EQUATIONS_PER_MEASUREMENT

      private static final int EQUATIONS_PER_MEASUREMENT
      Number of equations generated for each measurement.
      See Also:
    • COMMON_Z_AXIS_UNKNOWNS

      private static final int COMMON_Z_AXIS_UNKNOWNS
      Number of unknowns when common z-axis is assumed for both the accelerometer and gyroscope.
      See Also:
    • GENERAL_UNKNOWNS

      private static final int GENERAL_UNKNOWNS
      Number of unknowns for the general case.
      See Also:
    • measurements

      private Collection<FrameBodyKinematics> 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 commonAxisUsed
      This flag indicates whether z-axis is assumed to be common for accelerometer and gyroscope. When enabled, this eliminates 3 variables from Mg matrix.
    • listener

      Listener to handle events raised by this calibrator.
    • biasX

      private double biasX
      Known x coordinate of gyroscope bias expressed in radians per second (rad/s).
    • biasY

      private double biasY
      Known y coordinate of gyroscope bias expressed in radians per second (rad/s).
    • biasZ

      private double biasZ
      Known z coordinate of gyroscope bias expressed in radians per second (rad/s).
    • estimatedMg

      private com.irurueta.algebra.Matrix estimatedMg
      Estimated gyroscope scale factors and cross coupling errors. This is the product of matrix Tg containing cross coupling errors and Kg containing scaling factors. So that:
           Mg = [sx    mxy  mxz] = Tg*Kg
                [myx   sy   myz]
                [mzx   mzy  sz ]
       
      Where:
           Kg = [sx 0   0 ]
                [0  sy  0 ]
                [0  0   sz]
       
      and
           Tg = [1          -alphaXy    alphaXz ]
                [alphaYx    1           -alphaYz]
                [-alphaZx   alphaZy     1       ]
       
      Hence:
           Mg = [sx    mxy  mxz] = Tg*Kg =  [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 gyroscope z-axis is assumed to be the same as the body z-axis. When this is assumed, myx = mzx = mzy = 0 and the Mg matrix becomes upper diagonal:
           Mg = [sx    mxy  mxz]
                [0     sy   myz]
                [0     0    sz ]
       
      Values of this matrix are unit-less.
    • estimatedGg

      private com.irurueta.algebra.Matrix estimatedGg
      Estimated G-dependent cross biases introduced on the gyroscope by the specific forces sensed by the accelerometer. This instance allows any 3x3 matrix.
    • running

      private boolean running
      Indicates whether calibrator is running.
  • Constructor Details

    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator()
      Constructor.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(boolean commonAxisUsed)
      Constructor.
      Parameters:
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(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.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      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.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(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 gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ, boolean commonAxisUsed)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(double biasX, double biasY, double biasZ, boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(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 gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, double biasX, double biasY, double biasZ, boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasY - known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      biasZ - known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, boolean commonAxisUsed)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
      listener - listener to handle events raised by this calibrator.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, boolean commonAxisUsed)
      Constructor.
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
    • KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator

      public KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibrator(Collection<FrameBodyKinematics> measurements, com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ, boolean commonAxisUsed, KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener)
      Constructor.
      Parameters:
      measurements - collections of body kinematics measurements taken at different frames (positions, orientations and velocities).
      biasX - known x coordinate of gyroscope bias.
      biasY - known y coordinate of gyroscope bias.
      biasZ - known z coordinate of gyroscope bias.
      commonAxisUsed - indicates whether z-axis is assumed to be common for accelerometer and gyroscope.
      listener - listener to handle events raised by this calibrator.
  • Method Details

    • getMeasurements

      public Collection<FrameBodyKinematics> 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 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 interface KnownBiasAndFrameGyroscopeCalibrator<FrameBodyKinematics,KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener>
      Specified by:
      getMeasurements in interface UnorderedFrameBodyKinematicsGyroscopeCalibrator
      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 interface KnownBiasAndFrameGyroscopeCalibrator<FrameBodyKinematics,KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener>
      Specified by:
      setMeasurements in interface UnorderedFrameBodyKinematicsGyroscopeCalibrator
      Parameters:
      measurements - collection of body kinematics measurements taken at different frames (positions, orientations and velocities).
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getMeasurementOrSequenceType

      public GyroscopeCalibratorMeasurementOrSequenceType getMeasurementOrSequenceType()
      Indicates the type of measurement or sequence used by this calibrator.
      Specified by:
      getMeasurementOrSequenceType in interface GyroscopeCalibrator
      Returns:
      type of measurement or sequence used by this calibrator.
    • isOrderedMeasurementsOrSequencesRequired

      public boolean isOrderedMeasurementsOrSequencesRequired()
      Indicates whether this calibrator requires ordered measurements or sequences in a list or not.
      Specified by:
      isOrderedMeasurementsOrSequencesRequired in interface GyroscopeCalibrator
      Returns:
      true if measurements or sequences must be ordered, false otherwise.
    • isQualityScoresRequired

      public boolean isQualityScoresRequired()
      Indicates whether this calibrator requires quality scores for each measurement/sequence or not.
      Specified by:
      isQualityScoresRequired in interface GyroscopeCalibrator
      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 Mg matrix.
      Specified by:
      isCommonAxisUsed in interface GyroscopeCalibrator
      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 Mg matrix.
      Specified by:
      setCommonAxisUsed in interface GyroscopeCalibrator
      Parameters:
      commonAxisUsed - true if z-axis is assumed to be common for accelerometer and gyroscope, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getListener

      Gets listener to handle events raised by this calibrator.
      Specified by:
      getListener in interface KnownBiasAndFrameGyroscopeCalibrator<FrameBodyKinematics,KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener>
      Returns:
      listener to handle events raised by this calibrator.
    • setListener

      public void setListener(KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener listener) throws com.irurueta.navigation.LockedException
      Sets listener to handle events raised by this calibrator.
      Specified by:
      setListener in interface KnownBiasAndFrameGyroscopeCalibrator<FrameBodyKinematics,KnownBiasAndFrameGyroscopeLinearLeastSquaresCalibratorListener>
      Parameters:
      listener - listener to handle events raised by this calibrator.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasX

      public double getBiasX()
      Gets known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      getBiasX in interface KnownBiasGyroscopeCalibrator
      Returns:
      x coordinate of gyroscope bias.
    • setBiasX

      public void setBiasX(double biasX) throws com.irurueta.navigation.LockedException
      Sets known x coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      setBiasX in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasX - x coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasY

      public double getBiasY()
      Gets known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      getBiasY in interface KnownBiasGyroscopeCalibrator
      Returns:
      y coordinate of gyroscope bias.
    • setBiasY

      public void setBiasY(double biasY) throws com.irurueta.navigation.LockedException
      Sets known y coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      setBiasY in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasY - y coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasZ

      public double getBiasZ()
      Gets known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      getBiasZ in interface KnownBiasGyroscopeCalibrator
      Returns:
      z coordinate of gyroscope bias.
    • setBiasZ

      public void setBiasZ(double biasZ) throws com.irurueta.navigation.LockedException
      Sets known z coordinate of gyroscope bias expressed in radians per second (rad/s).
      Specified by:
      setBiasZ in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasZ - z coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasAngularSpeedX

      public com.irurueta.units.AngularSpeed getBiasAngularSpeedX()
      Gets known x coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedX in interface KnownBiasGyroscopeCalibrator
      Returns:
      x coordinate of gyroscope bias.
    • getBiasAngularSpeedX

      public void getBiasAngularSpeedX(com.irurueta.units.AngularSpeed result)
      Gets known x coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedX in interface KnownBiasGyroscopeCalibrator
      Parameters:
      result - instance where result data will be stored.
    • setBiasX

      public void setBiasX(com.irurueta.units.AngularSpeed biasX) throws com.irurueta.navigation.LockedException
      Sets known x coordinate of gyroscope bias.
      Specified by:
      setBiasX in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasX - x coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasAngularSpeedY

      public com.irurueta.units.AngularSpeed getBiasAngularSpeedY()
      Gets known y coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedY in interface KnownBiasGyroscopeCalibrator
      Returns:
      y coordinate of gyroscope bias.
    • getBiasAngularSpeedY

      public void getBiasAngularSpeedY(com.irurueta.units.AngularSpeed result)
      Gets known y coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedY in interface KnownBiasGyroscopeCalibrator
      Parameters:
      result - instance where result data will be stored.
    • setBiasY

      public void setBiasY(com.irurueta.units.AngularSpeed biasY) throws com.irurueta.navigation.LockedException
      Sets known y coordinate of gyroscope bias.
      Specified by:
      setBiasY in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasY - y coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasAngularSpeedZ

      public com.irurueta.units.AngularSpeed getBiasAngularSpeedZ()
      Gets known z coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedZ in interface KnownBiasGyroscopeCalibrator
      Returns:
      z coordinate of gyroscope bias.
    • getBiasAngularSpeedZ

      public void getBiasAngularSpeedZ(com.irurueta.units.AngularSpeed result)
      Gets known z coordinate of gyroscope bias.
      Specified by:
      getBiasAngularSpeedZ in interface KnownBiasGyroscopeCalibrator
      Parameters:
      result - instance where result data will be stored.
    • setBiasZ

      public void setBiasZ(com.irurueta.units.AngularSpeed biasZ) throws com.irurueta.navigation.LockedException
      Sets known z coordinate of gyroscope bias.
      Specified by:
      setBiasZ in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasZ - z coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • setBiasCoordinates

      public void setBiasCoordinates(double biasX, double biasY, double biasZ) throws com.irurueta.navigation.LockedException
      Sets known gyroscope bias coordinates expressed in radians per second (rad/s).
      Specified by:
      setBiasCoordinates in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasX - x coordinate of gyroscope bias.
      biasY - y coordinate of gyroscope bias.
      biasZ - z coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • setBiasCoordinates

      public void setBiasCoordinates(com.irurueta.units.AngularSpeed biasX, com.irurueta.units.AngularSpeed biasY, com.irurueta.units.AngularSpeed biasZ) throws com.irurueta.navigation.LockedException
      Sets known gyroscope bias coordinates.
      Specified by:
      setBiasCoordinates in interface KnownBiasGyroscopeCalibrator
      Parameters:
      biasX - x coordinate of gyroscope bias.
      biasY - y coordinate of gyroscope bias.
      biasZ - z coordinate of gyroscope bias.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBiasAsTriad

      public AngularSpeedTriad getBiasAsTriad()
      Gets known gyroscope bias.
      Returns:
      known gyroscope bias.
    • getBiasAsTriad

      public void getBiasAsTriad(AngularSpeedTriad result)
      Gets known gyroscope bias.
      Parameters:
      result - instance where result will be stored.
    • setBias

      public void setBias(AngularSpeedTriad bias) throws com.irurueta.navigation.LockedException
      Sets known gyroscope bias.
      Parameters:
      bias - gyroscope bias to be set.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
    • getBias

      public double[] getBias()
      Gets known gyroscope bias as an array. Array values are expressed in radians per second (rad/s).
      Specified by:
      getBias in interface KnownBiasGyroscopeCalibrator
      Returns:
      array containing coordinate of known bias.
    • getBias

      public void getBias(double[] result)
      Gets known gyroscope bias as an array. Array values are expressed in radians per second (rad/s).
      Specified by:
      getBias in interface KnownBiasGyroscopeCalibrator
      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 gyroscope bias as an array. Array values are expressed in radians per second (rad/s).
      Specified by:
      setBias in interface KnownBiasGyroscopeCalibrator
      Parameters:
      bias - known gyroscope 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 gyroscope bias as a column matrix.
      Specified by:
      getBiasAsMatrix in interface KnownBiasGyroscopeCalibrator
      Returns:
      known gyroscope bias as a column matrix.
    • getBiasAsMatrix

      public void getBiasAsMatrix(com.irurueta.algebra.Matrix result)
      Gets known gyroscope bias as a column matrix.
      Specified by:
      getBiasAsMatrix in interface KnownBiasGyroscopeCalibrator
      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 gyroscope bias as a column matrix.
      Specified by:
      setBias in interface KnownBiasGyroscopeCalibrator
      Parameters:
      bias - gyroscope bias to be set.
      Throws:
      com.irurueta.navigation.LockedException - if calibrator is currently running.
      IllegalArgumentException - if provided matrix is not 3x1.
    • getMinimumRequiredMeasurementsOrSequences

      public int getMinimumRequiredMeasurementsOrSequences()
      Gets minimum number of required measurements.
      Specified by:
      getMinimumRequiredMeasurementsOrSequences in interface GyroscopeCalibrator
      Returns:
      minimum number of required measurements.
    • isReady

      public boolean isReady()
      Indicates whether calibrator is ready to start the calibration.
      Specified by:
      isReady in interface GyroscopeCalibrator
      Returns:
      true if calibrator is ready, false otherwise.
    • isRunning

      public boolean isRunning()
      Indicates whether calibrator is currently running or not.
      Specified by:
      isRunning in interface GyroscopeCalibrator
      Returns:
      true if calibrator is running, false otherwise.
    • calibrate

      public void calibrate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, CalibrationException
      Estimates gyroscope calibration parameters containing bias, scale factors, cross-coupling errors and g-dependant cross biases.
      Specified by:
      calibrate in interface GyroscopeCalibrator
      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.
    • getEstimatedMg

      public com.irurueta.algebra.Matrix getEstimatedMg()
      Gets estimated gyroscope scale factors and cross coupling errors. This is the product of matrix Tg containing cross coupling errors and Kg containing scaling factors. So that:
           Mg = [sx    mxy  mxz] = Tg*Kg
                [myx   sy   myz]
                [mzx   mzy  sz ]
       
      Where:
           Kg = [sx 0   0 ]
                [0  sy  0 ]
                [0  0   sz]
       
      and
           Tg = [1          -alphaXy    alphaXz ]
                [alphaYx    1           -alphaYz]
                [-alphaZx   alphaZy     1       ]
       
      Hence:
           Mg = [sx    mxy  mxz] = Tg*Kg =  [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 gyroscope z-axis is assumed to be the same as the body z-axis. When this is assumed, myx = mzx = mzy = 0 and the Mg matrix becomes upper diagonal:
           Mg = [sx    mxy  mxz]
                [0     sy   myz]
                [0     0    sz ]
       
      Values of this matrix are unit-less.
      Specified by:
      getEstimatedMg in interface GyroscopeCalibrator
      Returns:
      estimated gyroscope scale factors and cross coupling errors.
    • getEstimatedSx

      public Double getEstimatedSx()
      Gets estimated x-axis scale factor.
      Specified by:
      getEstimatedSx in interface GyroscopeCalibrator
      Returns:
      estimated x-axis scale factor or null if not available.
    • getEstimatedSy

      public Double getEstimatedSy()
      Gets estimated y-axis scale factor.
      Specified by:
      getEstimatedSy in interface GyroscopeCalibrator
      Returns:
      estimated y-axis scale factor or null if not available.
    • getEstimatedSz

      public Double getEstimatedSz()
      Gets estimated z-axis scale factor.
      Specified by:
      getEstimatedSz in interface GyroscopeCalibrator
      Returns:
      estimated z-axis scale factor or null if not available.
    • getEstimatedMxy

      public Double getEstimatedMxy()
      Gets estimated x-y cross-coupling error.
      Specified by:
      getEstimatedMxy in interface GyroscopeCalibrator
      Returns:
      estimated x-y cross-coupling error or null if not available.
    • getEstimatedMxz

      public Double getEstimatedMxz()
      Gets estimated x-z cross-coupling error.
      Specified by:
      getEstimatedMxz in interface GyroscopeCalibrator
      Returns:
      estimated x-z cross-coupling error or null if not available.
    • getEstimatedMyx

      public Double getEstimatedMyx()
      Gets estimated y-x cross-coupling error.
      Specified by:
      getEstimatedMyx in interface GyroscopeCalibrator
      Returns:
      estimated y-x cross-coupling error or null if not available.
    • getEstimatedMyz

      public Double getEstimatedMyz()
      Gets estimated y-z cross-coupling error.
      Specified by:
      getEstimatedMyz in interface GyroscopeCalibrator
      Returns:
      estimated y-z cross-coupling error or null if not available.
    • getEstimatedMzx

      public Double getEstimatedMzx()
      Gets estimated z-x cross-coupling error.
      Specified by:
      getEstimatedMzx in interface GyroscopeCalibrator
      Returns:
      estimated z-x cross-coupling error or null if not available.
    • getEstimatedMzy

      public Double getEstimatedMzy()
      Gets estimated z-y cross-coupling error.
      Specified by:
      getEstimatedMzy in interface GyroscopeCalibrator
      Returns:
      estimated z-y cross-coupling error or null if not available.
    • getEstimatedGg

      public com.irurueta.algebra.Matrix getEstimatedGg()
      Gets estimated G-dependent cross biases introduced on the gyroscope by the specific forces sensed by the accelerometer.
      Specified by:
      getEstimatedGg in interface GyroscopeCalibrator
      Returns:
      a 3x3 matrix containing g-dependent cross biases.
    • calibrateCommonAxis

      private void calibrateCommonAxis() throws com.irurueta.algebra.AlgebraException
      Internal 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.AlgebraException
      Internal method to perform general calibration.
      Throws:
      com.irurueta.algebra.AlgebraException - if there are numerical errors.
    • fillMg

      private void fillMg(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 factor
      sy - y scale factor
      sz - z scale factor
      mxy - x-y cross coupling
      mxz - x-z cross coupling
      myx - y-x cross coupling
      myz - y-z cross coupling
      mzx - z-x cross coupling
      mzy - z-y cross coupling
      Throws:
      com.irurueta.algebra.WrongSizeException - never happens.
    • fillGg

      private void fillGg(double g11, double g12, double g13, double g21, double g22, double g23, double g31, double g32, double g33) throws com.irurueta.algebra.WrongSizeException
      Fills G-dependant cross biases.
      Parameters:
      g11 - element 1,1 of G-dependant cross biases matrix.
      g12 - element 1,2 of G-dependant cross biases matrix.
      g13 - element 1,3 of G-dependant cross biases matrix.
      g21 - element 2,1 of G-dependant cross biases matrix.
      g22 - element 2,2 of G-dependant cross biases matrix.
      g23 - element 2,3 of G-dependant cross biases matrix.
      g31 - element 3,1 of G-dependant cross biases matrix.
      g32 - element 3,2 of G-dependant cross biases matrix.
      g33 - element 3,3 of G-dependant cross biases matrix.
      Throws:
      com.irurueta.algebra.WrongSizeException - never happens.
    • convertAngularSpeed

      private static double convertAngularSpeed(double value, com.irurueta.units.AngularSpeedUnit unit)
      Converts angular speed instance to radians per second (rad/s).
      Parameters:
      value - angular speed value.
      unit - unit of angular speed value.
      Returns:
      converted value.
    • convertAngularSpeed

      private static double convertAngularSpeed(com.irurueta.units.AngularSpeed angularSpeed)
      Converts angular speed instance to radians per second (rad/s).
      Parameters:
      angularSpeed - angular speed instance to be converted.
      Returns:
      converted value.