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.magnetometer;
17  
18  import com.irurueta.algebra.Matrix;
19  import com.irurueta.algebra.WrongSizeException;
20  import com.irurueta.navigation.inertial.calibration.MagneticFluxDensityTriad;
21  import com.irurueta.units.MagneticFluxDensity;
22  
23  /**
24   * Interface for magnetometer calibrator where bias is unknown and needs to
25   * be estimated.
26   */
27  public interface UnknownHardIronMagnetometerCalibrator {
28  
29      /**
30       * Gets array containing x,y,z components of estimated magnetometer
31       * hard-iron biases expressed in Teslas (T).
32       *
33       * @return array containing x,y,z components of estimated magnetometer
34       * hard-iron biases.
35       */
36      double[] getEstimatedHardIron();
37  
38      /**
39       * Gets array containing x,y,z components of estimated magnetometer
40       * hard-iron biases expressed in Teslas (T).
41       *
42       * @param result instance where estimated magnetometer biases will be
43       *               stored.
44       * @return true if result instance was updated, false otherwise (when
45       * estimation is not yet available).
46       */
47      boolean getEstimatedHardIron(final double[] result);
48  
49      /**
50       * Gets column matrix containing x,y,z components of estimated
51       * magnetometer hard-iron biases expressed in Teslas (T).
52       *
53       * @return column matrix containing x,y,z components of estimated
54       * magnetometer hard-iron biases.
55       */
56      Matrix getEstimatedHardIronAsMatrix();
57  
58      /**
59       * Gets column matrix containing x,y,z components of estimated
60       * magnetometer hard-iron biases expressed in Teslas (T).
61       *
62       * @param result instance where result data will be stored.
63       * @return true if result was updated, false otherwise.
64       * @throws WrongSizeException if provided result instance has invalid size.
65       */
66      boolean getEstimatedHardIronAsMatrix(final Matrix result) throws WrongSizeException;
67  
68      /**
69       * Gets x coordinate of estimated magnetometer bias expressed in
70       * Teslas (T).
71       *
72       * @return x coordinate of estimated magnetometer bias or null if not
73       * available.
74       */
75      Double getEstimatedHardIronX();
76  
77      /**
78       * Gets y coordinate of estimated magnetometer bias expressed in
79       * Teslas (T).
80       *
81       * @return y coordinate of estimated magnetometer bias or null if not
82       * available.
83       */
84      Double getEstimatedHardIronY();
85  
86      /**
87       * Gets z coordinate of estimated magnetometer bias expressed in
88       * Teslas (T).
89       *
90       * @return z coordinate of estimated magnetometer bias or null if not
91       * available.
92       */
93      Double getEstimatedHardIronZ();
94  
95      /**
96       * Gets x coordinate of estimated magnetometer bias.
97       *
98       * @return x coordinate of estimated magnetometer bias.
99       */
100     MagneticFluxDensity getEstimatedHardIronXAsMagneticFluxDensity();
101 
102     /**
103      * Gets x coordinate of estimated magnetometer bias.
104      *
105      * @param result instance where result will be stored.
106      * @return true if estimated magnetometer bias is available, false otherwise.
107      */
108     boolean getEstimatedHardIronXAsMagneticFluxDensity(final MagneticFluxDensity result);
109 
110     /**
111      * Gets y coordinate of estimated magnetometer bias.
112      *
113      * @return y coordinate of estimated magnetometer bias.
114      */
115     MagneticFluxDensity getEstimatedHardIronYAsMagneticFluxDensity();
116 
117     /**
118      * Gets y coordinate of estimated magnetometer bias.
119      *
120      * @param result instance where result will be stored.
121      * @return true if estimated magnetometer bias is available, false otherwise.
122      */
123     boolean getEstimatedHardIronYAsMagneticFluxDensity(final MagneticFluxDensity result);
124 
125     /**
126      * Gets z coordinate of estimated magnetometer bias.
127      *
128      * @return z coordinate of estimated magnetometer bias.
129      */
130     MagneticFluxDensity getEstimatedHardIronZAsMagneticFluxDensity();
131 
132     /**
133      * Gets z coordinate of estimated magnetometer bias.
134      *
135      * @param result instance where result will be stored.
136      * @return true if estimated magnetometer bias is available, false otherwise.
137      */
138     boolean getEstimatedHardIronZAsMagneticFluxDensity(final MagneticFluxDensity result);
139 
140     /**
141      * Gets estimated magnetometer bias.
142      *
143      * @return estimated magnetometer bias or null if not available.
144      */
145     MagneticFluxDensityTriad getEstimatedHardIronAsTriad();
146 
147     /**
148      * Gets estimated magnetometer bias.
149      *
150      * @param result instance where result will be stored.
151      * @return true if estimated magnetometer bias is available and result was
152      * modified, false otherwise.
153      */
154     boolean getEstimatedHardIronAsTriad(final MagneticFluxDensityTriad result);
155 }