View Javadoc
1   /*
2    * Copyright (C) 2020 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.irurueta.navigation.inertial.calibration.gyroscope;
17  
18  import com.irurueta.algebra.Matrix;
19  import com.irurueta.navigation.LockedException;
20  import com.irurueta.navigation.NotReadyException;
21  import com.irurueta.navigation.frames.ECEFPosition;
22  import com.irurueta.navigation.frames.NEDPosition;
23  import com.irurueta.navigation.inertial.calibration.CalibrationException;
24  import com.irurueta.navigation.inertial.calibration.StandardDeviationBodyKinematics;
25  import com.irurueta.numerical.robust.RANSACRobustEstimator;
26  import com.irurueta.numerical.robust.RANSACRobustEstimatorListener;
27  import com.irurueta.numerical.robust.RobustEstimator;
28  import com.irurueta.numerical.robust.RobustEstimatorException;
29  import com.irurueta.numerical.robust.RobustEstimatorMethod;
30  
31  import java.util.List;
32  
33  /**
34   * Robustly estimates gyroscope cross couplings and scaling factors
35   * along with G-dependent cross biases introduced on the gyroscope by the
36   * specific forces sensed by the accelerometer using RANSAC robust estimator
37   * when gyroscope biases are known.
38   * <p>
39   * This calibrator assumes that the IMU is placed flat on a turntable spinning
40   * at constant speed, but absolute orientation or position of IMU is unknown.
41   * Turntable must rotate fast enough so that Earth rotation effects can be
42   * neglected, bus slow enough so that gyroscope readings can be properly made.
43   * <p>
44   * To use this calibrator at least 10 measurements are needed when common
45   * z-axis is assumed and G-dependent cross biases are ignored, otherwise
46   * at least 13 measurements are required when common z-axis is not assumed.
47   * If G-dependent cross biases are being estimated, then at least 19
48   * measurements are needed when common z-axis is assumed, otherwise at
49   * least 22 measurements are required when common z-axis is not assumed.
50   * <p>
51   * Measured gyroscope angular rates is assumed to follow the model shown below:
52   * <pre>
53   *     Ωmeas = bg + (I + Mg) * Ωtrue + Gg * ftrue + w
54   * </pre>
55   * Where:
56   * - Ωmeas is the measured gyroscope angular rates. This is a 3x1 vector.
57   * - bg is the gyroscope bias. Ideally, on a perfect gyroscope, this should be a
58   * 3x1 zero vector.
59   * - I is the 3x3 identity matrix.
60   * - Mg is the 3x3 matrix containing cross-couplings and scaling factors. Ideally, on
61   * a perfect gyroscope, this should be a 3x3 zero matrix.
62   * - Ωtrue is ground-truth gyroscope angular rates.
63   * - Gg is the G-dependent cross biases introduced by the specific forces sensed
64   * by the accelerometer. Ideally, on a perfect gyroscope, this should be a 3x3
65   * zero matrix.
66   * - ftrue is ground-truth specific force. This is a 3x1 vector.
67   * - w is measurement noise. This is a 3x1 vector.
68   */
69  public class RANSACRobustKnownBiasTurntableGyroscopeCalibrator extends RobustKnownBiasTurntableGyroscopeCalibrator {
70  
71      /**
72       * Constant defining default threshold to determine whether samples are inliers or not.
73       */
74      public static final double DEFAULT_THRESHOLD = 5e-1;
75  
76      /**
77       * Minimum value that can be set as threshold.
78       * Threshold must be strictly greater than 0.0.
79       */
80      public static final double MIN_THRESHOLD = 0.0;
81  
82      /**
83       * Indicates that by default inliers will only be computed but not kept.
84       */
85      public static final boolean DEFAULT_COMPUTE_AND_KEEP_INLIERS = false;
86  
87      /**
88       * Indicates that by default residuals will only be computed but not kept.
89       */
90      public static final boolean DEFAULT_COMPUTE_AND_KEEP_RESIDUALS = false;
91  
92      /**
93       * Threshold to determine whether samples are inliers or not when testing possible solutions.
94       * The threshold refers to the amount of error on distance between estimated position and
95       * distances provided for each sample.
96       */
97      private double threshold = DEFAULT_THRESHOLD;
98  
99      /**
100      * Indicates whether inliers must be computed and kept.
101      */
102     private boolean computeAndKeepInliers = DEFAULT_COMPUTE_AND_KEEP_INLIERS;
103 
104     /**
105      * Indicates whether residuals must be computed and kept.
106      */
107     private boolean computeAndKeepResiduals = DEFAULT_COMPUTE_AND_KEEP_RESIDUALS;
108 
109     /**
110      * Constructor.
111      */
112     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator() {
113         super();
114     }
115 
116     /**
117      * Constructor.
118      *
119      * @param position              position where body kinematics measures
120      *                              have been taken.
121      * @param turntableRotationRate constant rotation rate at which the
122      *                              turntable is spinning. Must be
123      *                              expressed in radians per second (rad/s).
124      * @param timeInterval          time interval between measurements being
125      *                              captured expressed in seconds (s).
126      * @param measurements          collection of body kinematics
127      *                              measurements with standard deviations
128      *                              taken at the same position with zero
129      *                              velocity and unknown different
130      *                              orientations.
131      * @param bias                  known gyroscope bias. This must be 3x1 and
132      *                              is expressed in radians per second
133      *                              (rad/s).
134      * @param initialMg             initial gyroscope scale factors and
135      *                              cross coupling errors matrix. Must
136      *                              be 3x3.
137      * @param initialGg             initial gyroscope G-dependent cross
138      *                              biases introduced on the gyroscope by
139      *                              the specific forces sensed by the
140      *                              accelerometer. Must be 3x3.
141      * @throws IllegalArgumentException if any of the provided values does
142      *                                  not have proper size or if either
143      *                                  turntable rotation rate or
144      *                                  time interval is zero or negative.
145      */
146     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
147             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
148             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
149             final Matrix initialGg) {
150         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg);
151     }
152 
153     /**
154      * Constructor.
155      *
156      * @param position              position where body kinematics measures
157      *                              have been taken.
158      * @param turntableRotationRate constant rotation rate at which the
159      *                              turntable is spinning. Must be
160      *                              expressed in radians per second (rad/s).
161      * @param timeInterval          time interval between measurements being
162      *                              captured expressed in seconds (s).
163      * @param measurements          collection of body kinematics
164      *                              measurements with standard deviations
165      *                              taken at the same position with zero
166      *                              velocity and unknown different
167      *                              orientations.
168      * @param bias                  known gyroscope bias. This must be 3x1 and
169      *                              is expressed in radians per second
170      *                              (rad/s).
171      * @param initialMg             initial gyroscope scale factors and
172      *                              cross coupling errors matrix. Must
173      *                              be 3x3.
174      * @param initialGg             initial gyroscope G-dependent cross
175      *                              biases introduced on the gyroscope by
176      *                              the specific forces sensed by the
177      *                              accelerometer. Must be 3x3.
178      * @param listener              listener to handle events raised by this
179      *                              calibrator.
180      * @throws IllegalArgumentException if any of the provided values does
181      *                                  not have proper size or if either
182      *                                  turntable rotation rate or
183      *                                  time interval is zero or negative.
184      */
185     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
186             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
187             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
188             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
189         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg, listener);
190     }
191 
192     /**
193      * Constructor.
194      *
195      * @param position              position where body kinematics measures
196      *                              have been taken.
197      * @param turntableRotationRate constant rotation rate at which the
198      *                              turntable is spinning. Must be
199      *                              expressed in radians per second (rad/s).
200      * @param timeInterval          time interval between measurements being
201      *                              captured expressed in seconds (s).
202      * @param measurements          collection of body kinematics
203      *                              measurements with standard deviations
204      *                              taken at the same position with zero
205      *                              velocity and unknown different
206      *                              orientations.
207      * @param bias                  known gyroscope bias. This must have
208      *                              length 3 and is expressed in radians
209      *                              per second (rad/s).
210      * @param initialMg             initial gyroscope scale factors and
211      *                              cross coupling errors matrix. Must
212      *                              be 3x3.
213      * @param initialGg             initial gyroscope G-dependent cross
214      *                              biases introduced on the gyroscope by
215      *                              the specific forces sensed by the
216      *                              accelerometer. Must be 3x3.
217      * @throws IllegalArgumentException if any of the provided values does
218      *                                  not have proper size or if either
219      *                                  turntable rotation rate or
220      *                                  time interval is zero or negative.
221      */
222     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
223             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
224             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
225             final Matrix initialGg) {
226         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg);
227     }
228 
229     /**
230      * Constructor.
231      *
232      * @param position              position where body kinematics measures
233      *                              have been taken.
234      * @param turntableRotationRate constant rotation rate at which the
235      *                              turntable is spinning. Must be
236      *                              expressed in radians per second (rad/s).
237      * @param timeInterval          time interval between measurements being
238      *                              captured expressed in seconds (s).
239      * @param measurements          collection of body kinematics
240      *                              measurements with standard deviations
241      *                              taken at the same position with zero
242      *                              velocity and unknown different
243      *                              orientations.
244      * @param bias                  known gyroscope bias. This must have length
245      *                              3 and is expressed in radians
246      *                              per second (rad/s).
247      * @param initialMg             initial gyroscope scale factors and
248      *                              cross coupling errors matrix. Must
249      *                              be 3x3.
250      * @param initialGg             initial gyroscope G-dependent cross
251      *                              biases introduced on the gyroscope by
252      *                              the specific forces sensed by the
253      *                              accelerometer. Must be 3x3.
254      * @param listener              listener to handle events raised by
255      *                              this calibrator.
256      * @throws IllegalArgumentException if any of the provided values does
257      *                                  not have proper size or if either
258      *                                  turntable rotation rate or
259      *                                  time interval is zero or negative.
260      */
261     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
262             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
263             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
264             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
265         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg, listener);
266     }
267 
268     /**
269      * Constructor.
270      *
271      * @param position              position where body kinematics measures
272      *                              have been taken.
273      * @param turntableRotationRate constant rotation rate at which the
274      *                              turntable is spinning. Must be
275      *                              expressed in radians per second (rad/s).
276      * @param timeInterval          time interval between measurements being
277      *                              captured expressed in seconds (s).
278      * @param measurements          collection of body kinematics
279      *                              measurements with standard deviations
280      *                              taken at the same position with zero
281      *                              velocity and unknown different
282      *                              orientations.
283      * @param bias                  known gyroscope bias. This must have length
284      *                              3 and is expressed in radians per
285      *                              second (rad/s).
286      * @param initialMg             initial gyroscope scale factors and
287      *                              cross coupling errors matrix. Must
288      *                              be 3x3.
289      * @param initialGg             initial gyroscope G-dependent cross
290      *                              biases introduced on the gyroscope by
291      *                              the specific forces sensed by the
292      *                              accelerometer. Must be 3x3.
293      * @param accelerometerBias     known accelerometer bias. This must
294      *                              have length 3 and is expressed in
295      *                              meters per squared second
296      *                              (m/s^2).
297      * @param accelerometerMa       known accelerometer scale factors and
298      *                              cross coupling matrix. Must be 3x3.
299      * @throws IllegalArgumentException if any of the provided values does
300      *                                  not have proper size or if either
301      *                                  turntable rotation rate or
302      *                                  time interval is zero or negative.
303      */
304     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
305             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
306             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
307             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa) {
308         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
309                 accelerometerBias, accelerometerMa);
310     }
311 
312     /**
313      * Constructor.
314      *
315      * @param position              position where body kinematics measures
316      *                              have been taken.
317      * @param turntableRotationRate constant rotation rate at which the
318      *                              turntable is spinning. Must be
319      *                              expressed in radians per second (rad/s).
320      * @param timeInterval          time interval between measurements being
321      *                              captured expressed in seconds (s).
322      * @param measurements          collection of body kinematics
323      *                              measurements with standard deviations
324      *                              taken at the same position with zero
325      *                              velocity and unknown different
326      *                              orientations.
327      * @param bias                  known gyroscope bias. This must have length
328      *                              3 and is expressed in radians per
329      *                              second (rad/s).
330      * @param initialMg             initial gyroscope scale factors and
331      *                              cross coupling errors matrix. Must
332      *                              be 3x3.
333      * @param initialGg             initial gyroscope G-dependent cross
334      *                              biases introduced on the gyroscope by
335      *                              the specific forces sensed by the
336      *                              accelerometer. Must be 3x3.
337      * @param accelerometerBias     known accelerometer bias. This must
338      *                              have length 3 and is expressed in
339      *                              meters per squared second (m/s^2).
340      * @param accelerometerMa       known accelerometer scale factors and
341      *                              cross coupling matrix. Must be 3x3.
342      * @param listener              listener to handle events raised by
343      *                              this calibrator.
344      * @throws IllegalArgumentException if any of the provided values does
345      *                                  not have proper size or if either
346      *                                  turntable rotation rate or
347      *                                  time interval is zero or negative.
348      */
349     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
350             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
351             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
352             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa,
353             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
354         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
355                 accelerometerBias, accelerometerMa, listener);
356     }
357 
358     /**
359      * Constructor.
360      *
361      * @param position              position where body kinematics measures
362      *                              have been taken.
363      * @param turntableRotationRate constant rotation rate at which the
364      *                              turntable is spinning. Must be
365      *                              expressed in radians per second (rad/s).
366      * @param timeInterval          time interval between measurements being
367      *                              captured expressed in seconds (s).
368      * @param measurements          collection of body kinematics
369      *                              measurements with standard deviations
370      *                              taken at the same position with zero
371      *                              velocity and unknown different
372      *                              orientations.
373      * @param bias                  known gyroscope bias. This must be 3x1 and
374      *                              is expressed in radians per second
375      *                              (rad/s).
376      * @param initialMg             initial gyroscope scale factors and
377      *                              cross coupling errors matrix. Must
378      *                              be 3x3.
379      * @param initialGg             initial gyroscope G-dependent cross
380      *                              biases introduced on the gyroscope by
381      *                              the specific forces sensed by the
382      *                              accelerometer. Must be 3x3.
383      * @param accelerometerBias     known accelerometer bias. This must
384      *                              have length 3 and is expressed in
385      *                              meters per squared second
386      *                              (m/s^2).
387      * @param accelerometerMa       known accelerometer scale factors and
388      *                              cross coupling matrix. Must be 3x3.
389      * @throws IllegalArgumentException if any of the provided values does
390      *                                  not have proper size or if either
391      *                                  turntable rotation rate or
392      *                                  time interval is zero or negative.
393      */
394     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
395             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
396             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
397             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa) {
398         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
399                 accelerometerBias, accelerometerMa);
400     }
401 
402     /**
403      * Constructor.
404      *
405      * @param position              position where body kinematics measures
406      *                              have been taken.
407      * @param turntableRotationRate constant rotation rate at which the
408      *                              turntable is spinning. Must be
409      *                              expressed in radians per second (rad/s).
410      * @param timeInterval          time interval between measurements being
411      *                              captured expressed in seconds (s).
412      * @param measurements          collection of body kinematics
413      *                              measurements with standard deviations
414      *                              taken at the same position with zero
415      *                              velocity and unknown different
416      *                              orientations.
417      * @param bias                  known gyroscope bias. This must be 3x1 and
418      *                              is expressed in radians per second
419      *                              (rad/s).
420      * @param initialMg             initial gyroscope scale factors and
421      *                              cross coupling errors matrix. Must
422      *                              be 3x3.
423      * @param initialGg             initial gyroscope G-dependent cross
424      *                              biases introduced on the gyroscope by
425      *                              the specific forces sensed by the
426      *                              accelerometer. Must be 3x3.
427      * @param accelerometerBias     known accelerometer bias. This must
428      *                              have length 3 and is expressed in
429      *                              meters per squared second (m/s^2).
430      * @param accelerometerMa       known accelerometer scale factors and
431      *                              cross coupling matrix. Must be 3x3.
432      * @param listener              listener to handle events raised by
433      *                              this calibrator.
434      * @throws IllegalArgumentException if any of the provided values does
435      *                                  not have proper size or if either
436      *                                  turntable rotation rate or
437      *                                  time interval is zero or negative.
438      */
439     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
440             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
441             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
442             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa,
443             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
444         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
445                 accelerometerBias, accelerometerMa, listener);
446     }
447 
448     /**
449      * Constructor.
450      *
451      * @param position                      position where body kinematics
452      *                                      measures have been taken.
453      * @param turntableRotationRate         constant rotation rate at which
454      *                                      the turntable is spinning. Must
455      *                                      be expressed in radians per
456      *                                      second (rad/s).
457      * @param timeInterval                  time interval between measurements
458      *                                      being captured expressed in
459      *                                      seconds (s).
460      * @param measurements                  collection of body kinematics
461      *                                      measurements with standard
462      *                                      deviations taken at the same
463      *                                      position with zero velocity
464      *                                      and unknown different
465      *                                      orientations.
466      * @param commonAxisUsed                indicates whether z-axis is
467      *                                      assumed to be common for
468      *                                      accelerometer and gyroscope.
469      * @param estimateGDependentCrossBiases true if G-dependent cross biases
470      *                                      will be estimated, false
471      *                                      otherwise.
472      * @param bias                          known gyroscope bias. This
473      *                                      must be 3x1 and is expressed in
474      *                                      radians per second (rad/s).
475      * @param initialMg                     initial gyroscope scale factors
476      *                                      and cross coupling errors matrix.
477      *                                      Must be 3x3.
478      * @param initialGg                     initial gyroscope G-dependent
479      *                                      cross biases introduced on the
480      *                                      gyroscope by the specific
481      *                                      forces sensed by the
482      *                                      accelerometer. Must be 3x3.
483      * @throws IllegalArgumentException if any of the provided values does
484      *                                  not have proper size or if either
485      *                                  turntable rotation rate or
486      *                                  time interval is zero or negative.
487      */
488     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
489             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
490             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
491             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
492             final Matrix initialGg) {
493         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
494                 estimateGDependentCrossBiases, bias, initialMg, initialGg);
495     }
496 
497     /**
498      * Constructor.
499      *
500      * @param position                      position where body kinematics
501      *                                      measures have been taken.
502      * @param turntableRotationRate         constant rotation rate at which
503      *                                      the turntable is spinning. Must
504      *                                      be expressed in radians per
505      *                                      second (rad/s).
506      * @param timeInterval                  time interval between measurements
507      *                                      being captured expressed in
508      *                                      seconds (s).
509      * @param measurements                  collection of body kinematics
510      *                                      measurements with standard
511      *                                      deviations taken at the same
512      *                                      position with zero velocity and
513      *                                      unknown different orientations.
514      * @param commonAxisUsed                indicates whether z-axis is
515      *                                      assumed to be common for
516      *                                      accelerometer and gyroscope.
517      * @param estimateGDependentCrossBiases true if G-dependent cross
518      *                                      biases will be estimated, false
519      *                                      otherwise.
520      * @param bias                          known gyroscope bias. This
521      *                                      must be 3x1 and is expressed in
522      *                                      radians per second (rad/s).
523      * @param initialMg                     initial gyroscope scale factors
524      *                                      and cross coupling errors
525      *                                      matrix. Must be 3x3.
526      * @param initialGg                     initial gyroscope G-dependent
527      *                                      cross biases introduced on the
528      *                                      gyroscope by the specific
529      *                                      forces sensed by the
530      *                                      accelerometer. Must be 3x3.
531      * @param listener                      listener to handle events
532      *                                      raised by this calibrator.
533      * @throws IllegalArgumentException if any of the provided values does
534      *                                  not have proper size or if either
535      *                                  turntable rotation rate or
536      *                                  time interval is zero or negative.
537      */
538     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
539             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
540             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
541             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
542             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
543         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
544                 estimateGDependentCrossBiases, bias, initialMg, initialGg, listener);
545     }
546 
547     /**
548      * Constructor.
549      *
550      * @param position                      position where body kinematics
551      *                                      measures have been taken.
552      * @param turntableRotationRate         constant rotation rate at which
553      *                                      the turntable is spinning. Must
554      *                                      be expressed in radians per
555      *                                      second (rad/s).
556      * @param timeInterval                  time interval between measurements
557      *                                      being captured expressed in
558      *                                      seconds (s).
559      * @param measurements                  collection of body kinematics
560      *                                      measurements with standard
561      *                                      deviations taken at the same
562      *                                      position with zero velocity
563      *                                      and unknown different
564      *                                      orientations.
565      * @param commonAxisUsed                indicates whether z-axis is
566      *                                      assumed to be common for
567      *                                      accelerometer and gyroscope.
568      * @param estimateGDependentCrossBiases true if G-dependent cross biases
569      *                                      will be estimated, false
570      *                                      otherwise.
571      * @param bias                          known gyroscope bias. This
572      *                                      must have length 3 and is
573      *                                      expressed in radians per second
574      *                                      (rad/s).
575      * @param initialMg                     initial gyroscope scale factors
576      *                                      and cross coupling errors matrix.
577      *                                      Must be 3x3.
578      * @param initialGg                     initial gyroscope G-dependent
579      *                                      cross biases introduced on the
580      *                                      gyroscope by the specific forces
581      *                                      sensed by the accelerometer.
582      *                                      Must be 3x3.
583      * @throws IllegalArgumentException if any of the provided values does
584      *                                  not have proper size or if either
585      *                                  turntable rotation rate or
586      *                                  time interval is zero or negative.
587      */
588     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
589             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
590             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
591             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
592             final Matrix initialGg) {
593         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
594                 estimateGDependentCrossBiases, bias, initialMg, initialGg);
595     }
596 
597     /**
598      * Constructor.
599      *
600      * @param position                      position where body kinematics
601      *                                      measures have been taken.
602      * @param turntableRotationRate         constant rotation rate at which
603      *                                      the turntable is spinning. Must
604      *                                      be expressed in radians per
605      *                                      second (rad/s).
606      * @param timeInterval                  time interval between measurements
607      *                                      being captured expressed in
608      *                                      seconds (s).
609      * @param measurements                  collection of body kinematics
610      *                                      measurements with standard
611      *                                      deviations taken at the same
612      *                                      position with zero velocity
613      *                                      and unknown different
614      *                                      orientations.
615      * @param commonAxisUsed                indicates whether z-axis is
616      *                                      assumed to be common for
617      *                                      accelerometer and gyroscope.
618      * @param estimateGDependentCrossBiases true if G-dependent cross biases
619      *                                      will be estimated, false
620      *                                      otherwise.
621      * @param bias                          known gyroscope bias. This
622      *                                      must have length 3 and is
623      *                                      expressed in radians per second
624      *                                      (rad/s).
625      * @param initialMg                     initial gyroscope scale factors
626      *                                      and cross coupling errors
627      *                                      matrix. Must be 3x3.
628      * @param initialGg                     initial gyroscope G-dependent
629      *                                      cross biases introduced on the
630      *                                      gyroscope by the specific forces
631      *                                      sensed by the accelerometer.
632      *                                      Must be 3x3.
633      * @param listener                      listener to handle events raised
634      *                                      by this calibrator.
635      * @throws IllegalArgumentException if any of the provided values does
636      *                                  not have proper size or if either
637      *                                  turntable rotation rate or
638      *                                  time interval is zero or negative.
639      */
640     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
641             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
642             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
643             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
644             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
645         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
646                 estimateGDependentCrossBiases, bias, initialMg, initialGg, listener);
647     }
648 
649     /**
650      * Constructor.
651      *
652      * @param position                      position where body kinematics
653      *                                      measures have been taken.
654      * @param turntableRotationRate         constant rotation rate at which
655      *                                      the turntable is spinning. Must
656      *                                      be expressed in radians per
657      *                                      second (rad/s).
658      * @param timeInterval                  time interval between measurements
659      *                                      being captured expressed in
660      *                                      seconds (s).
661      * @param measurements                  collection of body kinematics
662      *                                      measurements with standard
663      *                                      deviations taken at the same
664      *                                      position with zero velocity
665      *                                      and unknown different
666      *                                      orientations.
667      * @param commonAxisUsed                indicates whether z-axis is
668      *                                      assumed to be common for
669      *                                      accelerometer and gyroscope.
670      * @param estimateGDependentCrossBiases true if G-dependent cross
671      *                                      biases will be estimated,
672      *                                      false otherwise.
673      * @param bias                          known gyroscope bias. This
674      *                                      must have length 3 and is
675      *                                      expressed in radians per second
676      *                                      (rad/s).
677      * @param initialMg                     initial gyroscope scale factors
678      *                                      and cross coupling errors
679      *                                      matrix. Must be 3x3.
680      * @param initialGg                     initial gyroscope G-dependent
681      *                                      cross biases introduced on the
682      *                                      gyroscope by the specific forces
683      *                                      sensed by the accelerometer.
684      *                                      Must be 3x3.
685      * @param accelerometerBias             known accelerometer bias. This
686      *                                      must have length 3 and is
687      *                                      expressed in meters per squared
688      *                                      second (m/s^2).
689      * @param accelerometerMa               known accelerometer scale factors
690      *                                      and cross coupling matrix. Must
691      *                                      be 3x3.
692      * @throws IllegalArgumentException if any of the provided values does
693      *                                  not have proper size or if either
694      *                                  turntable rotation rate or
695      *                                  time interval is zero or negative.
696      */
697     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
698             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
699             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
700             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
701             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa) {
702         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
703                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa);
704     }
705 
706     /**
707      * Constructor.
708      *
709      * @param position                      position where body kinematics
710      *                                      measures have been taken.
711      * @param turntableRotationRate         constant rotation rate at which
712      *                                      the turntable is spinning. Must
713      *                                      be expressed in radians per
714      *                                      second (rad/s).
715      * @param timeInterval                  time interval between measurements
716      *                                      being captured expressed in
717      *                                      seconds (s).
718      * @param measurements                  collection of body kinematics
719      *                                      measurements with standard
720      *                                      deviations taken at the same
721      *                                      position with zero velocity
722      *                                      and unknown different
723      *                                      orientations.
724      * @param commonAxisUsed                indicates whether z-axis is
725      *                                      assumed to be common for
726      *                                      accelerometer and gyroscope.
727      * @param estimateGDependentCrossBiases true if G-dependent cross biases
728      *                                      will be estimated, false
729      *                                      otherwise.
730      * @param bias                          known gyroscope bias. This must
731      *                                      have length 3 and is expressed
732      *                                      in radians per second (rad/s).
733      * @param initialMg                     initial gyroscope scale factors
734      *                                      and cross coupling errors matrix.
735      *                                      Must be 3x3.
736      * @param initialGg                     initial gyroscope G-dependent
737      *                                      cross biases introduced on the
738      *                                      gyroscope by the specific forces
739      *                                      sensed by the accelerometer. Must
740      *                                      be 3x3.
741      * @param accelerometerBias             known accelerometer bias. This
742      *                                      must have length 3 and is
743      *                                      expressed in meters per squared
744      *                                      second (m/s^2).
745      * @param accelerometerMa               known accelerometer scale factors
746      *                                      and cross coupling matrix. Must
747      *                                      be 3x3.
748      * @param listener                      listener to handle events raised
749      *                                      by this calibrator.
750      * @throws IllegalArgumentException if any of the provided values does
751      *                                  not have proper size or if either
752      *                                  turntable rotation rate or
753      *                                  time interval is zero or negative.
754      */
755     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
756             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
757             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
758             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
759             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa,
760             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
761         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
762                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa,
763                 listener);
764     }
765 
766     /**
767      * Constructor.
768      *
769      * @param position                      position where body kinematics
770      *                                      measures have been taken.
771      * @param turntableRotationRate         constant rotation rate at which
772      *                                      the turntable is spinning. Must
773      *                                      be expressed in radians per
774      *                                      second (rad/s).
775      * @param timeInterval                  time interval between measurements
776      *                                      being captured expressed in
777      *                                      seconds (s).
778      * @param measurements                  collection of body kinematics
779      *                                      measurements with standard
780      *                                      deviations taken at the same
781      *                                      position with zero velocity and
782      *                                      unknown different orientations.
783      * @param commonAxisUsed                indicates whether z-axis is
784      *                                      assumed to be common for
785      *                                      accelerometer and gyroscope.
786      * @param estimateGDependentCrossBiases true if G-dependent cross biases
787      *                                      will be estimated, false
788      *                                      otherwise.
789      * @param bias                          known gyroscope bias. This
790      *                                      must be 3x1 and is expressed in
791      *                                      radians per second (rad/s).
792      * @param initialMg                     initial gyroscope scale factors
793      *                                      and cross coupling errors matrix.
794      *                                      Must be 3x3.
795      * @param initialGg                     initial gyroscope G-dependent
796      *                                      cross biases introduced on the
797      *                                      gyroscope by the specific forces
798      *                                      sensed by the accelerometer. Must
799      *                                      be 3x3.
800      * @param accelerometerBias             known accelerometer bias. This
801      *                                      must have length 3 and is
802      *                                      expressed in meters per squared
803      *                                      second (m/s^2).
804      * @param accelerometerMa               known accelerometer scale factors
805      *                                      and cross coupling matrix. Must
806      *                                      be 3x3.
807      * @throws IllegalArgumentException if any of the provided values does
808      *                                  not have proper size or if either
809      *                                  turntable rotation rate or
810      *                                  time interval is zero or negative.
811      */
812     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
813             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
814             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
815             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
816             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa) {
817         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
818                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa);
819     }
820 
821     /**
822      * Constructor.
823      *
824      * @param position                      position where body kinematics
825      *                                      measures have been taken.
826      * @param turntableRotationRate         constant rotation rate at which
827      *                                      the turntable is spinning. Must
828      *                                      be expressed in radians per
829      *                                      second (rad/s).
830      * @param timeInterval                  time interval between measurements
831      *                                      being captured expressed in
832      *                                      seconds (s).
833      * @param measurements                  collection of body kinematics
834      *                                      measurements with standard
835      *                                      deviations taken at the same
836      *                                      position with zero velocity and
837      *                                      unknown different orientations.
838      * @param commonAxisUsed                indicates whether z-axis is
839      *                                      assumed to be common for
840      *                                      accelerometer and gyroscope.
841      * @param estimateGDependentCrossBiases true if G-dependent cross biases
842      *                                      will be estimated, false
843      *                                      otherwise.
844      * @param bias                          known gyroscope bias. This must be
845      *                                      3x1 and is expressed in radians
846      *                                      per second (rad/s).
847      * @param initialMg                     initial gyroscope scale factors
848      *                                      and cross coupling errors matrix.
849      *                                      Must be 3x3.
850      * @param initialGg                     initial gyroscope G-dependent
851      *                                      cross biases introduced on the
852      *                                      gyroscope by the specific forces
853      *                                      sensed by the accelerometer. Must
854      *                                      be 3x3.
855      * @param accelerometerBias             known accelerometer bias. This
856      *                                      must have length 3 and is
857      *                                      expressed in meters per squared
858      *                                      second (m/s^2).
859      * @param accelerometerMa               known accelerometer scale factors
860      *                                      and cross coupling matrix. Must
861      *                                      be 3x3.
862      * @param listener                      listener to handle events raised
863      *                                      by this calibrator.
864      * @throws IllegalArgumentException if any of the provided values does
865      *                                  not have proper size or if either
866      *                                  turntable rotation rate or
867      *                                  time interval is zero or negative.
868      */
869     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
870             final ECEFPosition position, final double turntableRotationRate, final double timeInterval,
871             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
872             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
873             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa,
874             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
875         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
876                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa,
877                 listener);
878     }
879 
880     /**
881      * Constructor.
882      *
883      * @param position              position where body kinematics measures
884      *                              have been taken.
885      * @param turntableRotationRate constant rotation rate at which the
886      *                              turntable is spinning. Must be
887      *                              expressed in radians per second (rad/s).
888      * @param timeInterval          time interval between measurements being
889      *                              captured expressed in seconds (s).
890      * @param measurements          collection of body kinematics
891      *                              measurements with standard deviations
892      *                              taken at the same position with zero
893      *                              velocity and unknown different
894      *                              orientations.
895      * @param bias                  known gyroscope bias. This must be 3x1 and
896      *                              is expressed in radians per second
897      *                              (rad/s).
898      * @param initialMg             initial gyroscope scale factors and
899      *                              cross coupling errors matrix. Must
900      *                              be 3x3.
901      * @param initialGg             initial gyroscope G-dependent cross
902      *                              biases introduced on the gyroscope by
903      *                              the specific forces sensed by the
904      *                              accelerometer. Must be 3x3.
905      * @throws IllegalArgumentException if any of the provided values does
906      *                                  not have proper size or if either
907      *                                  turntable rotation rate or
908      *                                  time interval is zero or negative.
909      */
910     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
911             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
912             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
913             final Matrix initialGg) {
914         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg);
915     }
916 
917     /**
918      * Constructor.
919      *
920      * @param position              position where body kinematics measures
921      *                              have been taken.
922      * @param turntableRotationRate constant rotation rate at which the
923      *                              turntable is spinning. Must be
924      *                              expressed in radians per second (rad/s).
925      * @param timeInterval          time interval between measurements being
926      *                              captured expressed in seconds (s).
927      * @param measurements          collection of body kinematics
928      *                              measurements with standard deviations
929      *                              taken at the same position with zero
930      *                              velocity and unknown different
931      *                              orientations.
932      * @param bias                  known gyroscope bias. This must be 3x1 and
933      *                              is expressed in radians per second
934      *                              (rad/s).
935      * @param initialMg             initial gyroscope scale factors and
936      *                              cross coupling errors matrix. Must
937      *                              be 3x3.
938      * @param initialGg             initial gyroscope G-dependent cross
939      *                              biases introduced on the gyroscope by
940      *                              the specific forces sensed by the
941      *                              accelerometer. Must be 3x3.
942      * @param listener              listener to handle events raised by this
943      *                              calibrator.
944      * @throws IllegalArgumentException if any of the provided values does
945      *                                  not have proper size or if either
946      *                                  turntable rotation rate or
947      *                                  time interval is zero or negative.
948      */
949     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
950             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
951             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
952             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
953         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg, listener);
954     }
955 
956     /**
957      * Constructor.
958      *
959      * @param position              position where body kinematics measures
960      *                              have been taken.
961      * @param turntableRotationRate constant rotation rate at which the
962      *                              turntable is spinning. Must be
963      *                              expressed in radians per second (rad/s).
964      * @param timeInterval          time interval between measurements being
965      *                              captured expressed in seconds (s).
966      * @param measurements          collection of body kinematics
967      *                              measurements with standard deviations
968      *                              taken at the same position with zero
969      *                              velocity and unknown different
970      *                              orientations.
971      * @param bias                  known gyroscope bias. This must have
972      *                              length 3 and is expressed in radians
973      *                              per second (rad/s).
974      * @param initialMg             initial gyroscope scale factors and
975      *                              cross coupling errors matrix. Must
976      *                              be 3x3.
977      * @param initialGg             initial gyroscope G-dependent cross
978      *                              biases introduced on the gyroscope by
979      *                              the specific forces sensed by the
980      *                              accelerometer. Must be 3x3.
981      * @throws IllegalArgumentException if any of the provided values does
982      *                                  not have proper size or if either
983      *                                  turntable rotation rate or
984      *                                  time interval is zero or negative.
985      */
986     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
987             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
988             final List<StandardDeviationBodyKinematics> measurements, final double[] bias,
989             final Matrix initialMg, final Matrix initialGg) {
990         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg);
991     }
992 
993     /**
994      * Constructor.
995      *
996      * @param position              position where body kinematics measures
997      *                              have been taken.
998      * @param turntableRotationRate constant rotation rate at which the
999      *                              turntable is spinning. Must be
1000      *                              expressed in radians per second (rad/s).
1001      * @param timeInterval          time interval between measurements being
1002      *                              captured expressed in seconds (s).
1003      * @param measurements          collection of body kinematics
1004      *                              measurements with standard deviations
1005      *                              taken at the same position with zero
1006      *                              velocity and unknown different
1007      *                              orientations.
1008      * @param bias                  known gyroscope bias. This must have length
1009      *                              3 and is expressed in radians
1010      *                              per second (rad/s).
1011      * @param initialMg             initial gyroscope scale factors and
1012      *                              cross coupling errors matrix. Must
1013      *                              be 3x3.
1014      * @param initialGg             initial gyroscope G-dependent cross
1015      *                              biases introduced on the gyroscope by
1016      *                              the specific forces sensed by the
1017      *                              accelerometer. Must be 3x3.
1018      * @param listener              listener to handle events raised by
1019      *                              this calibrator.
1020      * @throws IllegalArgumentException if any of the provided values does
1021      *                                  not have proper size or if either
1022      *                                  turntable rotation rate or
1023      *                                  time interval is zero or negative.
1024      */
1025     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1026             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1027             final List<StandardDeviationBodyKinematics> measurements, final double[] bias,
1028             final Matrix initialMg, final Matrix initialGg,
1029             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1030         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg, listener);
1031     }
1032 
1033     /**
1034      * Constructor.
1035      *
1036      * @param position              position where body kinematics measures
1037      *                              have been taken.
1038      * @param turntableRotationRate constant rotation rate at which the
1039      *                              turntable is spinning. Must be
1040      *                              expressed in radians per second (rad/s).
1041      * @param timeInterval          time interval between measurements being
1042      *                              captured expressed in seconds (s).
1043      * @param measurements          collection of body kinematics
1044      *                              measurements with standard deviations
1045      *                              taken at the same position with zero
1046      *                              velocity and unknown different
1047      *                              orientations.
1048      * @param bias                  known gyroscope bias. This must have length
1049      *                              3 and is expressed in radians per
1050      *                              second (rad/s).
1051      * @param initialMg             initial gyroscope scale factors and
1052      *                              cross coupling errors matrix. Must
1053      *                              be 3x3.
1054      * @param initialGg             initial gyroscope G-dependent cross
1055      *                              biases introduced on the gyroscope by
1056      *                              the specific forces sensed by the
1057      *                              accelerometer. Must be 3x3.
1058      * @param accelerometerBias     known accelerometer bias. This must
1059      *                              have length 3 and is expressed in
1060      *                              meters per squared second
1061      *                              (m/s^2).
1062      * @param accelerometerMa       known accelerometer scale factors and
1063      *                              cross coupling matrix. Must be 3x3.
1064      * @throws IllegalArgumentException if any of the provided values does
1065      *                                  not have proper size or if either
1066      *                                  turntable rotation rate or
1067      *                                  time interval is zero or negative.
1068      */
1069     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1070             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1071             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
1072             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa) {
1073         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
1074                 accelerometerBias, accelerometerMa);
1075     }
1076 
1077     /**
1078      * Constructor.
1079      *
1080      * @param position              position where body kinematics measures
1081      *                              have been taken.
1082      * @param turntableRotationRate constant rotation rate at which the
1083      *                              turntable is spinning. Must be
1084      *                              expressed in radians per second (rad/s).
1085      * @param timeInterval          time interval between measurements being
1086      *                              captured expressed in seconds (s).
1087      * @param measurements          collection of body kinematics
1088      *                              measurements with standard deviations
1089      *                              taken at the same position with zero
1090      *                              velocity and unknown different
1091      *                              orientations.
1092      * @param bias                  known gyroscope bias. This must have length
1093      *                              3 and is expressed in radians per
1094      *                              second (rad/s).
1095      * @param initialMg             initial gyroscope scale factors and
1096      *                              cross coupling errors matrix. Must
1097      *                              be 3x3.
1098      * @param initialGg             initial gyroscope G-dependent cross
1099      *                              biases introduced on the gyroscope by
1100      *                              the specific forces sensed by the
1101      *                              accelerometer. Must be 3x3.
1102      * @param accelerometerBias     known accelerometer bias. This must
1103      *                              have length 3 and is expressed in
1104      *                              meters per squared second (m/s^2).
1105      * @param accelerometerMa       known accelerometer scale factors and
1106      *                              cross coupling matrix. Must be 3x3.
1107      * @param listener              listener to handle events raised by
1108      *                              this calibrator.
1109      * @throws IllegalArgumentException if any of the provided values does
1110      *                                  not have proper size or if either
1111      *                                  turntable rotation rate or
1112      *                                  time interval is zero or negative.
1113      */
1114     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1115             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1116             final List<StandardDeviationBodyKinematics> measurements, final double[] bias, final Matrix initialMg,
1117             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa,
1118             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1119         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
1120                 accelerometerBias, accelerometerMa, listener);
1121     }
1122 
1123     /**
1124      * Constructor.
1125      *
1126      * @param position              position where body kinematics measures
1127      *                              have been taken.
1128      * @param turntableRotationRate constant rotation rate at which the
1129      *                              turntable is spinning. Must be
1130      *                              expressed in radians per second (rad/s).
1131      * @param timeInterval          time interval between measurements being
1132      *                              captured expressed in seconds (s).
1133      * @param measurements          collection of body kinematics
1134      *                              measurements with standard deviations
1135      *                              taken at the same position with zero
1136      *                              velocity and unknown different
1137      *                              orientations.
1138      * @param bias                  known gyroscope bias. This must be 3x1 and
1139      *                              is expressed in radians per second
1140      *                              (rad/s).
1141      * @param initialMg             initial gyroscope scale factors and
1142      *                              cross coupling errors matrix. Must
1143      *                              be 3x3.
1144      * @param initialGg             initial gyroscope G-dependent cross
1145      *                              biases introduced on the gyroscope by
1146      *                              the specific forces sensed by the
1147      *                              accelerometer. Must be 3x3.
1148      * @param accelerometerBias     known accelerometer bias. This must
1149      *                              have length 3 and is expressed in
1150      *                              meters per squared second
1151      *                              (m/s^2).
1152      * @param accelerometerMa       known accelerometer scale factors and
1153      *                              cross coupling matrix. Must be 3x3.
1154      * @throws IllegalArgumentException if any of the provided values does
1155      *                                  not have proper size or if either
1156      *                                  turntable rotation rate or
1157      *                                  time interval is zero or negative.
1158      */
1159     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1160             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1161             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
1162             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa) {
1163         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
1164                 accelerometerBias, accelerometerMa);
1165     }
1166 
1167     /**
1168      * Constructor.
1169      *
1170      * @param position              position where body kinematics measures
1171      *                              have been taken.
1172      * @param turntableRotationRate constant rotation rate at which the
1173      *                              turntable is spinning. Must be
1174      *                              expressed in radians per second (rad/s).
1175      * @param timeInterval          time interval between measurements being
1176      *                              captured expressed in seconds (s).
1177      * @param measurements          collection of body kinematics
1178      *                              measurements with standard deviations
1179      *                              taken at the same position with zero
1180      *                              velocity and unknown different
1181      *                              orientations.
1182      * @param bias                  known gyroscope bias. This must be 3x1 and
1183      *                              is expressed in radians per second
1184      *                              (rad/s).
1185      * @param initialMg             initial gyroscope scale factors and
1186      *                              cross coupling errors matrix. Must
1187      *                              be 3x3.
1188      * @param initialGg             initial gyroscope G-dependent cross
1189      *                              biases introduced on the gyroscope by
1190      *                              the specific forces sensed by the
1191      *                              accelerometer. Must be 3x3.
1192      * @param accelerometerBias     known accelerometer bias. This must
1193      *                              have length 3 and is expressed in
1194      *                              meters per squared second (m/s^2).
1195      * @param accelerometerMa       known accelerometer scale factors and
1196      *                              cross coupling matrix. Must be 3x3.
1197      * @param listener              listener to handle events raised by
1198      *                              this calibrator.
1199      * @throws IllegalArgumentException if any of the provided values does
1200      *                                  not have proper size or if either
1201      *                                  turntable rotation rate or
1202      *                                  time interval is zero or negative.
1203      */
1204     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1205             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1206             final List<StandardDeviationBodyKinematics> measurements, final Matrix bias, final Matrix initialMg,
1207             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa,
1208             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1209         super(position, turntableRotationRate, timeInterval, measurements, bias, initialMg, initialGg,
1210                 accelerometerBias, accelerometerMa, listener);
1211     }
1212 
1213     /**
1214      * Constructor.
1215      *
1216      * @param position                      position where body kinematics
1217      *                                      measures have been taken.
1218      * @param turntableRotationRate         constant rotation rate at which
1219      *                                      the turntable is spinning. Must
1220      *                                      be expressed in radians per
1221      *                                      second (rad/s).
1222      * @param timeInterval                  time interval between measurements
1223      *                                      being captured expressed in
1224      *                                      seconds (s).
1225      * @param measurements                  collection of body kinematics
1226      *                                      measurements with standard
1227      *                                      deviations taken at the same
1228      *                                      position with zero velocity
1229      *                                      and unknown different
1230      *                                      orientations.
1231      * @param commonAxisUsed                indicates whether z-axis is
1232      *                                      assumed to be common for
1233      *                                      accelerometer and gyroscope.
1234      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1235      *                                      will be estimated, false
1236      *                                      otherwise.
1237      * @param bias                          known gyroscope bias. This
1238      *                                      must be 3x1 and is expressed in
1239      *                                      radians per second (rad/s).
1240      * @param initialMg                     initial gyroscope scale factors
1241      *                                      and cross coupling errors matrix.
1242      *                                      Must be 3x3.
1243      * @param initialGg                     initial gyroscope G-dependent
1244      *                                      cross biases introduced on the
1245      *                                      gyroscope by the specific
1246      *                                      forces sensed by the
1247      *                                      accelerometer. Must be 3x3.
1248      * @throws IllegalArgumentException if any of the provided values does
1249      *                                  not have proper size or if either
1250      *                                  turntable rotation rate or
1251      *                                  time interval is zero or negative.
1252      */
1253     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1254             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1255             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1256             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
1257             final Matrix initialGg) {
1258         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1259                 estimateGDependentCrossBiases, bias, initialMg, initialGg);
1260     }
1261 
1262     /**
1263      * Constructor.
1264      *
1265      * @param position                      position where body kinematics
1266      *                                      measures have been taken.
1267      * @param turntableRotationRate         constant rotation rate at which
1268      *                                      the turntable is spinning. Must
1269      *                                      be expressed in radians per
1270      *                                      second (rad/s).
1271      * @param timeInterval                  time interval between measurements
1272      *                                      being captured expressed in
1273      *                                      seconds (s).
1274      * @param measurements                  collection of body kinematics
1275      *                                      measurements with standard
1276      *                                      deviations taken at the same
1277      *                                      position with zero velocity and
1278      *                                      unknown different orientations.
1279      * @param commonAxisUsed                indicates whether z-axis is
1280      *                                      assumed to be common for
1281      *                                      accelerometer and gyroscope.
1282      * @param estimateGDependentCrossBiases true if G-dependent cross
1283      *                                      biases will be estimated, false
1284      *                                      otherwise.
1285      * @param bias                          known gyroscope bias. This
1286      *                                      must be 3x1 and is expressed in
1287      *                                      radians per second (rad/s).
1288      * @param initialMg                     initial gyroscope scale factors
1289      *                                      and cross coupling errors
1290      *                                      matrix. Must be 3x3.
1291      * @param initialGg                     initial gyroscope G-dependent
1292      *                                      cross biases introduced on the
1293      *                                      gyroscope by the specific
1294      *                                      forces sensed by the
1295      *                                      accelerometer. Must be 3x3.
1296      * @param listener                      listener to handle events
1297      *                                      raised by this calibrator.
1298      * @throws IllegalArgumentException if any of the provided values does
1299      *                                  not have proper size or if either
1300      *                                  turntable rotation rate or
1301      *                                  time interval is zero or negative.
1302      */
1303     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1304             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1305             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1306             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
1307             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1308         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1309                 estimateGDependentCrossBiases, bias, initialMg, initialGg, listener);
1310     }
1311 
1312     /**
1313      * Constructor.
1314      *
1315      * @param position                      position where body kinematics
1316      *                                      measures have been taken.
1317      * @param turntableRotationRate         constant rotation rate at which
1318      *                                      the turntable is spinning. Must
1319      *                                      be expressed in radians per
1320      *                                      second (rad/s).
1321      * @param timeInterval                  time interval between measurements
1322      *                                      being captured expressed in
1323      *                                      seconds (s).
1324      * @param measurements                  collection of body kinematics
1325      *                                      measurements with standard
1326      *                                      deviations taken at the same
1327      *                                      position with zero velocity
1328      *                                      and unknown different
1329      *                                      orientations.
1330      * @param commonAxisUsed                indicates whether z-axis is
1331      *                                      assumed to be common for
1332      *                                      accelerometer and gyroscope.
1333      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1334      *                                      will be estimated, false
1335      *                                      otherwise.
1336      * @param bias                          known gyroscope bias. This
1337      *                                      must have length 3 and is
1338      *                                      expressed in radians per second
1339      *                                      (rad/s).
1340      * @param initialMg                     initial gyroscope scale factors
1341      *                                      and cross coupling errors matrix.
1342      *                                      Must be 3x3.
1343      * @param initialGg                     initial gyroscope G-dependent
1344      *                                      cross biases introduced on the
1345      *                                      gyroscope by the specific forces
1346      *                                      sensed by the accelerometer.
1347      *                                      Must be 3x3.
1348      * @throws IllegalArgumentException if any of the provided values does
1349      *                                  not have proper size or if either
1350      *                                  turntable rotation rate or
1351      *                                  time interval is zero or negative.
1352      */
1353     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1354             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1355             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1356             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
1357             final Matrix initialGg) {
1358         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1359                 estimateGDependentCrossBiases, bias, initialMg, initialGg);
1360     }
1361 
1362     /**
1363      * Constructor.
1364      *
1365      * @param position                      position where body kinematics
1366      *                                      measures have been taken.
1367      * @param turntableRotationRate         constant rotation rate at which
1368      *                                      the turntable is spinning. Must
1369      *                                      be expressed in radians per
1370      *                                      second (rad/s).
1371      * @param timeInterval                  time interval between measurements
1372      *                                      being captured expressed in
1373      *                                      seconds (s).
1374      * @param measurements                  collection of body kinematics
1375      *                                      measurements with standard
1376      *                                      deviations taken at the same
1377      *                                      position with zero velocity
1378      *                                      and unknown different
1379      *                                      orientations.
1380      * @param commonAxisUsed                indicates whether z-axis is
1381      *                                      assumed to be common for
1382      *                                      accelerometer and gyroscope.
1383      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1384      *                                      will be estimated, false
1385      *                                      otherwise.
1386      * @param bias                          known gyroscope bias. This
1387      *                                      must have length 3 and is
1388      *                                      expressed in radians per second
1389      *                                      (rad/s).
1390      * @param initialMg                     initial gyroscope scale factors
1391      *                                      and cross coupling errors
1392      *                                      matrix. Must be 3x3.
1393      * @param initialGg                     initial gyroscope G-dependent
1394      *                                      cross biases introduced on the
1395      *                                      gyroscope by the specific forces
1396      *                                      sensed by the accelerometer.
1397      *                                      Must be 3x3.
1398      * @param listener                      listener to handle events raised
1399      *                                      by this calibrator.
1400      * @throws IllegalArgumentException if any of the provided values does
1401      *                                  not have proper size or if either
1402      *                                  turntable rotation rate or
1403      *                                  time interval is zero or negative.
1404      */
1405     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1406             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1407             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1408             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
1409             final Matrix initialGg, final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1410         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1411                 estimateGDependentCrossBiases, bias, initialMg, initialGg, listener);
1412     }
1413 
1414     /**
1415      * Constructor.
1416      *
1417      * @param position                      position where body kinematics
1418      *                                      measures have been taken.
1419      * @param turntableRotationRate         constant rotation rate at which
1420      *                                      the turntable is spinning. Must
1421      *                                      be expressed in radians per
1422      *                                      second (rad/s).
1423      * @param timeInterval                  time interval between measurements
1424      *                                      being captured expressed in
1425      *                                      seconds (s).
1426      * @param measurements                  collection of body kinematics
1427      *                                      measurements with standard
1428      *                                      deviations taken at the same
1429      *                                      position with zero velocity
1430      *                                      and unknown different
1431      *                                      orientations.
1432      * @param commonAxisUsed                indicates whether z-axis is
1433      *                                      assumed to be common for
1434      *                                      accelerometer and gyroscope.
1435      * @param estimateGDependentCrossBiases true if G-dependent cross
1436      *                                      biases will be estimated,
1437      *                                      false otherwise.
1438      * @param bias                          known gyroscope bias. This
1439      *                                      must have length 3 and is
1440      *                                      expressed in radians per second
1441      *                                      (rad/s).
1442      * @param initialMg                     initial gyroscope scale factors
1443      *                                      and cross coupling errors
1444      *                                      matrix. Must be 3x3.
1445      * @param initialGg                     initial gyroscope G-dependent
1446      *                                      cross biases introduced on the
1447      *                                      gyroscope by the specific forces
1448      *                                      sensed by the accelerometer.
1449      *                                      Must be 3x3.
1450      * @param accelerometerBias             known accelerometer bias. This
1451      *                                      must have length 3 and is
1452      *                                      expressed in meters per squared
1453      *                                      second (m/s^2).
1454      * @param accelerometerMa               known accelerometer scale factors
1455      *                                      and cross coupling matrix. Must
1456      *                                      be 3x3.
1457      * @throws IllegalArgumentException if any of the provided values does
1458      *                                  not have proper size or if either
1459      *                                  turntable rotation rate or
1460      *                                  time interval is zero or negative.
1461      */
1462     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1463             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1464             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1465             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
1466             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa) {
1467         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1468                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa);
1469     }
1470 
1471     /**
1472      * Constructor.
1473      *
1474      * @param position                      position where body kinematics
1475      *                                      measures have been taken.
1476      * @param turntableRotationRate         constant rotation rate at which
1477      *                                      the turntable is spinning. Must
1478      *                                      be expressed in radians per
1479      *                                      second (rad/s).
1480      * @param timeInterval                  time interval between measurements
1481      *                                      being captured expressed in
1482      *                                      seconds (s).
1483      * @param measurements                  collection of body kinematics
1484      *                                      measurements with standard
1485      *                                      deviations taken at the same
1486      *                                      position with zero velocity
1487      *                                      and unknown different
1488      *                                      orientations.
1489      * @param commonAxisUsed                indicates whether z-axis is
1490      *                                      assumed to be common for
1491      *                                      accelerometer and gyroscope.
1492      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1493      *                                      will be estimated, false
1494      *                                      otherwise.
1495      * @param bias                          known gyroscope bias. This must
1496      *                                      have length 3 and is expressed
1497      *                                      in radians per second (rad/s).
1498      * @param initialMg                     initial gyroscope scale factors
1499      *                                      and cross coupling errors matrix.
1500      *                                      Must be 3x3.
1501      * @param initialGg                     initial gyroscope G-dependent
1502      *                                      cross biases introduced on the
1503      *                                      gyroscope by the specific forces
1504      *                                      sensed by the accelerometer. Must
1505      *                                      be 3x3.
1506      * @param accelerometerBias             known accelerometer bias. This
1507      *                                      must have length 3 and is
1508      *                                      expressed in meters per squared
1509      *                                      second (m/s^2).
1510      * @param accelerometerMa               known accelerometer scale factors
1511      *                                      and cross coupling matrix. Must
1512      *                                      be 3x3.
1513      * @param listener                      listener to handle events raised
1514      *                                      by this calibrator.
1515      * @throws IllegalArgumentException if any of the provided values does
1516      *                                  not have proper size or if either
1517      *                                  turntable rotation rate or
1518      *                                  time interval is zero or negative.
1519      */
1520     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1521             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1522             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1523             final boolean estimateGDependentCrossBiases, final double[] bias, final Matrix initialMg,
1524             final Matrix initialGg, final double[] accelerometerBias, final Matrix accelerometerMa,
1525             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1526         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1527                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa,
1528                 listener);
1529     }
1530 
1531     /**
1532      * Constructor.
1533      *
1534      * @param position                      position where body kinematics
1535      *                                      measures have been taken.
1536      * @param turntableRotationRate         constant rotation rate at which
1537      *                                      the turntable is spinning. Must
1538      *                                      be expressed in radians per
1539      *                                      second (rad/s).
1540      * @param timeInterval                  time interval between measurements
1541      *                                      being captured expressed in
1542      *                                      seconds (s).
1543      * @param measurements                  collection of body kinematics
1544      *                                      measurements with standard
1545      *                                      deviations taken at the same
1546      *                                      position with zero velocity and
1547      *                                      unknown different orientations.
1548      * @param commonAxisUsed                indicates whether z-axis is
1549      *                                      assumed to be common for
1550      *                                      accelerometer and gyroscope.
1551      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1552      *                                      will be estimated, false
1553      *                                      otherwise.
1554      * @param bias                          known gyroscope bias. This
1555      *                                      must be 3x1 and is expressed in
1556      *                                      radians per second (rad/s).
1557      * @param initialMg                     initial gyroscope scale factors
1558      *                                      and cross coupling errors matrix.
1559      *                                      Must be 3x3.
1560      * @param initialGg                     initial gyroscope G-dependent
1561      *                                      cross biases introduced on the
1562      *                                      gyroscope by the specific forces
1563      *                                      sensed by the accelerometer. Must
1564      *                                      be 3x3.
1565      * @param accelerometerBias             known accelerometer bias. This
1566      *                                      must have length 3 and is
1567      *                                      expressed in meters per squared
1568      *                                      second (m/s^2).
1569      * @param accelerometerMa               known accelerometer scale factors
1570      *                                      and cross coupling matrix. Must
1571      *                                      be 3x3.
1572      * @throws IllegalArgumentException if any of the provided values does
1573      *                                  not have proper size or if either
1574      *                                  turntable rotation rate or
1575      *                                  time interval is zero or negative.
1576      */
1577     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1578             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1579             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1580             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
1581             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa) {
1582         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1583                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa);
1584     }
1585 
1586     /**
1587      * Constructor.
1588      *
1589      * @param position                      position where body kinematics
1590      *                                      measures have been taken.
1591      * @param turntableRotationRate         constant rotation rate at which
1592      *                                      the turntable is spinning. Must
1593      *                                      be expressed in radians per
1594      *                                      second (rad/s).
1595      * @param timeInterval                  time interval between measurements
1596      *                                      being captured expressed in
1597      *                                      seconds (s).
1598      * @param measurements                  collection of body kinematics
1599      *                                      measurements with standard
1600      *                                      deviations taken at the same
1601      *                                      position with zero velocity and
1602      *                                      unknown different orientations.
1603      * @param commonAxisUsed                indicates whether z-axis is
1604      *                                      assumed to be common for
1605      *                                      accelerometer and gyroscope.
1606      * @param estimateGDependentCrossBiases true if G-dependent cross biases
1607      *                                      will be estimated, false
1608      *                                      otherwise.
1609      * @param bias                          known gyroscope bias. This must be
1610      *                                      3x1 and is expressed in radians
1611      *                                      per second (rad/s).
1612      * @param initialMg                     initial gyroscope scale factors
1613      *                                      and cross coupling errors matrix.
1614      *                                      Must be 3x3.
1615      * @param initialGg                     initial gyroscope G-dependent
1616      *                                      cross biases introduced on the
1617      *                                      gyroscope by the specific forces
1618      *                                      sensed by the accelerometer. Must
1619      *                                      be 3x3.
1620      * @param accelerometerBias             known accelerometer bias. This
1621      *                                      must have length 3 and is
1622      *                                      expressed in meters per squared
1623      *                                      second (m/s^2).
1624      * @param accelerometerMa               known accelerometer scale factors
1625      *                                      and cross coupling matrix. Must
1626      *                                      be 3x3.
1627      * @param listener                      listener to handle events raised
1628      *                                      by this calibrator.
1629      * @throws IllegalArgumentException if any of the provided values does
1630      *                                  not have proper size or if either
1631      *                                  turntable rotation rate or
1632      *                                  time interval is zero or negative.
1633      */
1634     public RANSACRobustKnownBiasTurntableGyroscopeCalibrator(
1635             final NEDPosition position, final double turntableRotationRate, final double timeInterval,
1636             final List<StandardDeviationBodyKinematics> measurements, final boolean commonAxisUsed,
1637             final boolean estimateGDependentCrossBiases, final Matrix bias, final Matrix initialMg,
1638             final Matrix initialGg, final Matrix accelerometerBias, final Matrix accelerometerMa,
1639             final RobustKnownBiasTurntableGyroscopeCalibratorListener listener) {
1640         super(position, turntableRotationRate, timeInterval, measurements, commonAxisUsed,
1641                 estimateGDependentCrossBiases, bias, initialMg, initialGg, accelerometerBias, accelerometerMa,
1642                 listener);
1643     }
1644 
1645     /**
1646      * Gets threshold to determine whether samples are inliers or not when testing possible solutions.
1647      * The threshold refers to the amount of error on norm between measured angular rates and the
1648      * ones generated with estimated calibration parameters provided for each sample.
1649      *
1650      * @return threshold to determine whether samples are inliers or not.
1651      */
1652     public double getThreshold() {
1653         return threshold;
1654     }
1655 
1656     /**
1657      * Sets threshold to determine whether samples are inliers or not when testing possible solutions.
1658      * The threshold refers to the amount of error on norm between measured angular rates and the
1659      * ones generated with estimated calibration parameters provided for each sample.
1660      *
1661      * @param threshold threshold to determine whether samples are inliers or not.
1662      * @throws IllegalArgumentException if provided value is equal or less than zero.
1663      * @throws LockedException          if calibrator is currently running.
1664      */
1665     public void setThreshold(final double threshold) throws LockedException {
1666         if (running) {
1667             throw new LockedException();
1668         }
1669         if (threshold <= MIN_THRESHOLD) {
1670             throw new IllegalArgumentException();
1671         }
1672         this.threshold = threshold;
1673     }
1674 
1675     /**
1676      * Indicates whether inliers must be computed and kept.
1677      *
1678      * @return true if inliers must be computed and kept, false if inliers
1679      * only need to be computed but not kept.
1680      */
1681     public boolean isComputeAndKeepInliersEnabled() {
1682         return computeAndKeepInliers;
1683     }
1684 
1685     /**
1686      * Specifies whether inliers must be computed and kept.
1687      *
1688      * @param computeAndKeepInliers true if inliers must be computed and kept,
1689      *                              false if inliers only need to be computed but not kept.
1690      * @throws LockedException if calibrator is currently running.
1691      */
1692     public void setComputeAndKeepInliersEnabled(final boolean computeAndKeepInliers) throws LockedException {
1693         if (running) {
1694             throw new LockedException();
1695         }
1696         this.computeAndKeepInliers = computeAndKeepInliers;
1697     }
1698 
1699     /**
1700      * Indicates whether residuals must be computed and kept.
1701      *
1702      * @return true if residuals must be computed and kept, false if residuals
1703      * only need to be computed but not kept.
1704      */
1705     public boolean isComputeAndKeepResiduals() {
1706         return computeAndKeepResiduals;
1707     }
1708 
1709     /**
1710      * Specifies whether residuals must be computed and kept.
1711      *
1712      * @param computeAndKeepResiduals true if residuals must be computed and kept,
1713      *                                false if residuals only need to be computed but not kept.
1714      * @throws LockedException if calibrator is currently running.
1715      */
1716     public void setComputeAndKeepResidualsEnabled(final boolean computeAndKeepResiduals) throws LockedException {
1717         if (running) {
1718             throw new LockedException();
1719         }
1720         this.computeAndKeepResiduals = computeAndKeepResiduals;
1721     }
1722 
1723     /**
1724      * Estimates gyroscope calibration parameters containing scale factors
1725      * cross-coupling errors and g-dependant cross biases.
1726      *
1727      * @throws LockedException      if calibrator is currently running.
1728      * @throws NotReadyException    if calibrator is not ready.
1729      * @throws CalibrationException if estimation fails for numerical reasons.
1730      */
1731     @Override
1732     public void calibrate() throws LockedException, NotReadyException, CalibrationException {
1733         if (running) {
1734             throw new LockedException();
1735         }
1736         if (!isReady()) {
1737             throw new NotReadyException();
1738         }
1739 
1740         final var innerEstimator = new RANSACRobustEstimator<>(new RANSACRobustEstimatorListener<PreliminaryResult>() {
1741             @Override
1742             public double getThreshold() {
1743                 return threshold;
1744             }
1745 
1746             @Override
1747             public int getTotalSamples() {
1748                 return measurements.size();
1749             }
1750 
1751             @Override
1752             public int getSubsetSize() {
1753                 return preliminarySubsetSize;
1754             }
1755 
1756             @Override
1757             public void estimatePreliminarSolutions(
1758                     final int[] samplesIndices, final List<PreliminaryResult> solutions) {
1759                 computePreliminarySolutions(samplesIndices, solutions);
1760             }
1761 
1762             @Override
1763             public double computeResidual(final PreliminaryResult currentEstimation, final int i) {
1764                 return computeError(measurements.get(i), currentEstimation);
1765             }
1766 
1767             @Override
1768             public boolean isReady() {
1769                 return RANSACRobustKnownBiasTurntableGyroscopeCalibrator.super.isReady();
1770             }
1771 
1772             @Override
1773             public void onEstimateStart(final RobustEstimator<PreliminaryResult> estimator) {
1774                 // no action needed
1775             }
1776 
1777             @Override
1778             public void onEstimateEnd(final RobustEstimator<PreliminaryResult> estimator) {
1779                 // no action needed
1780             }
1781 
1782             @Override
1783             public void onEstimateNextIteration(
1784                     final RobustEstimator<PreliminaryResult> estimator, final int iteration) {
1785                 if (listener != null) {
1786                     listener.onCalibrateNextIteration(
1787                             RANSACRobustKnownBiasTurntableGyroscopeCalibrator.this, iteration);
1788                 }
1789             }
1790 
1791             @Override
1792             public void onEstimateProgressChange(
1793                     final RobustEstimator<PreliminaryResult> estimator, final float progress) {
1794                 if (listener != null) {
1795                     listener.onCalibrateProgressChange(
1796                             RANSACRobustKnownBiasTurntableGyroscopeCalibrator.this, progress);
1797                 }
1798             }
1799         });
1800 
1801         try {
1802             running = true;
1803 
1804             if (listener != null) {
1805                 listener.onCalibrateStart(this);
1806             }
1807 
1808             inliersData = null;
1809             innerEstimator.setComputeAndKeepInliersEnabled(computeAndKeepInliers || refineResult);
1810             innerEstimator.setComputeAndKeepResidualsEnabled(computeAndKeepResiduals || refineResult);
1811             innerEstimator.setConfidence(confidence);
1812             innerEstimator.setMaxIterations(maxIterations);
1813             innerEstimator.setProgressDelta(progressDelta);
1814             final var preliminaryResult = innerEstimator.estimate();
1815             inliersData = innerEstimator.getInliersData();
1816 
1817             attemptRefine(preliminaryResult);
1818 
1819             if (listener != null) {
1820                 listener.onCalibrateEnd(this);
1821             }
1822 
1823         } catch (final com.irurueta.numerical.LockedException e) {
1824             throw new LockedException(e);
1825         } catch (final com.irurueta.numerical.NotReadyException e) {
1826             throw new NotReadyException(e);
1827         } catch (final RobustEstimatorException e) {
1828             throw new CalibrationException(e);
1829         } finally {
1830             running = false;
1831         }
1832     }
1833 
1834     /**
1835      * Returns method being used for robust estimation.
1836      *
1837      * @return method being used for robust estimation.
1838      */
1839     @Override
1840     public RobustEstimatorMethod getMethod() {
1841         return RobustEstimatorMethod.RANSAC;
1842     }
1843 
1844     /**
1845      * Indicates whether this calibrator requires quality scores for each
1846      * measurement/sequence or not.
1847      *
1848      * @return true if quality scores are required, false otherwise.
1849      */
1850     @Override
1851     public boolean isQualityScoresRequired() {
1852         return false;
1853     }
1854 }