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