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