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.navigation.LockedException;
20 import com.irurueta.navigation.inertial.calibration.MagneticFluxDensityTriad;
21 import com.irurueta.units.MagneticFluxDensity;
22
23 /**
24 * Interface for non-linear magnetometer calibrator where hard-iron bias is
25 * unknown and needs to be estimated.
26 */
27 public interface UnknownHardIronNonLinearMagnetometerCalibrator extends UnknownHardIronMagnetometerCalibrator {
28
29 /**
30 * Gets initial x-coordinate of magnetometer hard-iron bias to be used
31 * to find a solution.
32 * This is expressed in Teslas (T).
33 *
34 * @return initial x-coordinate of magnetometer hard-iron bias.
35 */
36 double getInitialHardIronX();
37
38 /**
39 * Sets initial x-coordinate of magnetometer hard-iron bias to be used
40 * to find a solution.
41 * This is expressed in Teslas (T).
42 *
43 * @param initialHardIronX initial x-coordinate of magnetometer
44 * hard-iron bias.
45 * @throws LockedException if calibrator is currently running.
46 */
47 void setInitialHardIronX(final double initialHardIronX) throws LockedException;
48
49 /**
50 * Gets initial y-coordinate of magnetometer hard-iron bias to be used
51 * to find a solution.
52 * This is expressed in Teslas (T).
53 *
54 * @return initial y-coordinate of magnetometer hard-iron bias.
55 */
56 double getInitialHardIronY();
57
58 /**
59 * Sets initial y-coordinate of magnetometer hard-iron bias to be used
60 * to find a solution.
61 * This is expressed in Teslas (T).
62 *
63 * @param initialHardIronY initial y-coordinate of magnetometer
64 * hard-iron bias.
65 * @throws LockedException if calibrator is currently running.
66 */
67 void setInitialHardIronY(final double initialHardIronY) throws LockedException;
68
69 /**
70 * Gets initial z-coordinate of magnetometer hard-iron bias to be used
71 * to find a solution.
72 * This is expressed in Teslas (T).
73 *
74 * @return initial z-coordinate of magnetometer hard-iron bias.
75 */
76 double getInitialHardIronZ();
77
78 /**
79 * Sets initial z-coordinate of magnetometer hard-iron bias to be used
80 * to find a solution.
81 * This is expressed in meters Teslas (T).
82 *
83 * @param initialHardIronZ initial z-coordinate of magnetometer
84 * hard-iron bias.
85 * @throws LockedException if calibrator is currently running.
86 */
87 void setInitialHardIronZ(final double initialHardIronZ) throws LockedException;
88
89 /**
90 * Gets initial x-coordinate of magnetometer hard iron bias to be used
91 * to find a solution.
92 *
93 * @return initial x-coordinate of magnetometer hard-iron bias.
94 */
95 MagneticFluxDensity getInitialHardIronXAsMagneticFluxDensity();
96
97 /**
98 * Gets initial x-coordinate of magnetometer hard iron bias to be used
99 * to find a solution.
100 *
101 * @param result instance where result will be stored.
102 */
103 void getInitialHardIronXAsMagneticFluxDensity(final MagneticFluxDensity result);
104
105 /**
106 * Sets initial x-coordinate of magnetometer hard iron bias to be used
107 * to find a solution.
108 *
109 * @param initialHardIronX initial x-coordinate of magnetometer bias.
110 * @throws LockedException if calibrator is currently running.
111 */
112 void setInitialHardIronX(final MagneticFluxDensity initialHardIronX) throws LockedException;
113
114 /**
115 * Gets initial y-coordinate of magnetometer hard iron bias to be used
116 * to find a solution.
117 *
118 * @return initial y-coordinate of magnetometer hard-iron bias.
119 */
120 MagneticFluxDensity getInitialHardIronYAsMagneticFluxDensity();
121
122 /**
123 * Gets initial y-coordinate of magnetometer hard iron bias to be used
124 * to find a solution.
125 *
126 * @param result instance where result will be stored.
127 */
128 void getInitialHardIronYAsMagneticFluxDensity(final MagneticFluxDensity result);
129
130 /**
131 * Sets initial y-coordinate of magnetometer hard iron bias to be used
132 * to find a solution.
133 *
134 * @param initialHardIronY initial y-coordinate of magnetometer bias.
135 * @throws LockedException if calibrator is currently running.
136 */
137 void setInitialHardIronY(final MagneticFluxDensity initialHardIronY) throws LockedException;
138
139 /**
140 * Gets initial z-coordinate of magnetometer hard iron bias to be used
141 * to find a solution.
142 *
143 * @return initial z-coordinate of magnetometer hard-iron bias.
144 */
145 MagneticFluxDensity getInitialHardIronZAsMagneticFluxDensity();
146
147 /**
148 * Gets initial z-coordinate of magnetometer hard iron bias to be used
149 * to find a solution.
150 *
151 * @param result instance where result will be stored.
152 */
153 void getInitialHardIronZAsMagneticFluxDensity(final MagneticFluxDensity result);
154
155 /**
156 * Sets initial z-coordinate of magnetometer hard iron bias to be used
157 * to find a solution.
158 *
159 * @param initialHardIronZ initial z-coordinate of magnetometer bias.
160 * @throws LockedException if calibrator is currently running.
161 */
162 void setInitialHardIronZ(final MagneticFluxDensity initialHardIronZ) throws LockedException;
163
164 /**
165 * Sets initial hard-iron bias coordinates of magnetometer used to find
166 * a solution expressed in Teslas (T).
167 *
168 * @param initialHardIronX initial x-coordinate of magnetometer
169 * hard-iron bias.
170 * @param initialHardIronY initial y-coordinate of magnetometer
171 * hard-iron bias.
172 * @param initialHardIronZ initial z-coordinate of magnetometer
173 * hard-iron bias.
174 * @throws LockedException if calibrator is currently running.
175 */
176 void setInitialHardIron(
177 final double initialHardIronX, final double initialHardIronY, final double initialHardIronZ)
178 throws LockedException;
179
180 /**
181 * Sets initial hard iron coordinates of magnetometer used to find a solution.
182 *
183 * @param initialHardIronX initial x-coordinate of magnetometer bias.
184 * @param initialHardIronY initial y-coordinate of magnetometer bias.
185 * @param initialHardIronZ initial z-coordinate of magnetometer bias.
186 * @throws LockedException if calibrator is currently running.
187 */
188 void setInitialHardIron(
189 final MagneticFluxDensity initialHardIronX, final MagneticFluxDensity initialHardIronY,
190 final MagneticFluxDensity initialHardIronZ) throws LockedException;
191
192 /**
193 * Gets initial hard-iron used to find a solution.
194 *
195 * @return initial hard-iron.
196 */
197 MagneticFluxDensityTriad getInitialHardIronAsTriad();
198
199 /**
200 * Gets initial hard-iron used to find a solution.
201 *
202 * @param result instance where result will be stored.
203 */
204 void getInitialHardIronAsTriad(final MagneticFluxDensityTriad result);
205
206 /**
207 * Sets initial hard-iron used to find a solution.
208 *
209 * @param initialHardIron initial hard-iron to be set.
210 * @throws LockedException if calibrator is currently running.
211 */
212 void setInitialHardIron(final MagneticFluxDensityTriad initialHardIron) throws LockedException;
213
214 /**
215 * Gets initial hard-iron bias to be used to find a solution as an array.
216 * Array values are expressed in Teslas (T).
217 *
218 * @return array containing coordinates of initial bias.
219 */
220 double[] getInitialHardIron();
221
222 /**
223 * Gets initial hard-iron bias to be used to find a solution as an array.
224 * Array values are expressed in Teslas (T).
225 *
226 * @param result instance where result data will be copied to.
227 * @throws IllegalArgumentException if provided array does not have
228 * length 3.
229 */
230 void getInitialHardIron(final double[] result);
231
232 /**
233 * Sets initial hard-iron bias to be used to find a solution as an array.
234 * Array values are expressed in Teslas (T).
235 *
236 * @param initialHardIron initial hard-iron to find a solution.
237 * @throws LockedException if calibrator is currently running.
238 * @throws IllegalArgumentException if provided array does not have length 3.
239 */
240 void setInitialHardIron(final double[] initialHardIron) throws LockedException;
241
242 /**
243 * Gets initial hard-iron bias to be used to find a solution as a
244 * column matrix.
245 *
246 * @return initial hard-iron bias to be used to find a solution as a
247 * column matrix.
248 */
249 Matrix getInitialHardIronAsMatrix();
250
251 /**
252 * Gets initial hard-iron bias to be used to find a solution as a
253 * column matrix.
254 *
255 * @param result instance where result data will be copied to.
256 * @throws IllegalArgumentException if provided matrix is not 3x1.
257 */
258 void getInitialHardIronAsMatrix(final Matrix result);
259
260 /**
261 * Sets initial hard-iron bias to be used to find a solution as an array.
262 *
263 * @param initialHardIron initial hard-iron bias to find a solution.
264 * @throws LockedException if calibrator is currently running.
265 * @throws IllegalArgumentException if provided matrix is not 3x1.
266 */
267 void setInitialHardIron(final Matrix initialHardIron) throws LockedException;
268 }