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