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.inertial.calibration.AccelerationTriad;
21 import com.irurueta.units.Acceleration;
22
23 /**
24 * Interface for accelerometer calibrator where bias is known.
25 */
26 public interface KnownBiasAccelerometerCalibrator {
27
28 /**
29 * Gets known x coordinate of accelerometer bias expressed in meters per squared
30 * second (m/s^2).
31 *
32 * @return x coordinate of accelerometer bias.
33 */
34 double getBiasX();
35
36 /**
37 * Sets known x coordinate of accelerometer bias expressed in meters per squared
38 * second (m/s^2).
39 *
40 * @param biasX x coordinate of accelerometer bias.
41 * @throws LockedException if calibrator is currently running.
42 */
43 void setBiasX(final double biasX) throws LockedException;
44
45 /**
46 * Gets known y coordinate of accelerometer bias expressed in meters per squared
47 * second (m/s^2).
48 *
49 * @return y coordinate of accelerometer bias.
50 */
51 double getBiasY();
52
53 /**
54 * Sets known y coordinate of accelerometer bias expressed in meters per squared
55 * second (m/s^2).
56 *
57 * @param biasY y coordinate of accelerometer bias.
58 * @throws LockedException if calibrator is currently running.
59 */
60 void setBiasY(final double biasY) throws LockedException;
61
62 /**
63 * Gets known z coordinate of accelerometer bias expressed in meters per squared
64 * second (m/s^2).
65 *
66 * @return z coordinate of accelerometer bias.
67 */
68 double getBiasZ();
69
70 /**
71 * Sets known z coordinate of accelerometer bias expressed in meters per squared
72 * second (m/s^2).
73 *
74 * @param biasZ z coordinate of accelerometer bias.
75 * @throws LockedException if calibrator is currently running.
76 */
77 void setBiasZ(final double biasZ) throws LockedException;
78
79 /**
80 * Gets known x coordinate of accelerometer bias.
81 *
82 * @return x coordinate of accelerometer bias.
83 */
84 Acceleration getBiasXAsAcceleration();
85
86 /**
87 * Gets known x coordinate of accelerometer bias.
88 *
89 * @param result instance where result data will be stored.
90 */
91 void getBiasXAsAcceleration(final Acceleration result);
92
93 /**
94 * Sets known x coordinate of accelerometer bias.
95 *
96 * @param biasX x coordinate of accelerometer bias.
97 * @throws LockedException if calibrator is currently running.
98 */
99 void setBiasX(final Acceleration biasX) throws LockedException;
100
101 /**
102 * Gets known y coordinate of accelerometer bias.
103 *
104 * @return y coordinate of accelerometer bias.
105 */
106 Acceleration getBiasYAsAcceleration();
107
108 /**
109 * Gets known y coordinate of accelerometer bias.
110 *
111 * @param result instance where result data will be stored.
112 */
113 void getBiasYAsAcceleration(final Acceleration result);
114
115 /**
116 * Sets known y coordinate of accelerometer bias.
117 *
118 * @param biasY y coordinate of accelerometer bias.
119 * @throws LockedException if estimator is currently running.
120 */
121 void setBiasY(final Acceleration biasY) throws LockedException;
122
123 /**
124 * Gets known z coordinate of accelerometer bias.
125 *
126 * @return z coordinate of accelerometer bias.
127 */
128 Acceleration getBiasZAsAcceleration();
129
130 /**
131 * Gets known z coordinate of accelerometer bias.
132 *
133 * @param result instance where result data will be stored.
134 */
135 void getBiasZAsAcceleration(final Acceleration result);
136
137 /**
138 * Sets known z coordinate of accelerometer bias.
139 *
140 * @param biasZ z coordinate of accelerometer bias.
141 * @throws LockedException if estimator is currently running.
142 */
143 void setBiasZ(final Acceleration biasZ) throws LockedException;
144
145 /**
146 * Sets known accelerometer bias coordinates expressed in meters per squared
147 * second (m/s^2).
148 *
149 * @param biasX x coordinate of accelerometer bias.
150 * @param biasY y coordinate of accelerometer bias.
151 * @param biasZ z coordinate of accelerometer bias.
152 * @throws LockedException if calibrator is currently running.
153 */
154 void setBiasCoordinates(final double biasX, final double biasY, final double biasZ)
155 throws LockedException;
156
157 /**
158 * Sets known accelerometer bias coordinates.
159 *
160 * @param biasX z coordinate of accelerometer bias.
161 * @param biasY y coordinate of accelerometer bias.
162 * @param biasZ z coordinate of accelerometer bias.
163 * @throws LockedException if calibrator is currently running.
164 */
165 void setBiasCoordinates(final Acceleration biasX, final Acceleration biasY,
166 final Acceleration biasZ) throws LockedException;
167
168 /**
169 * Gets known accelerometer bias.
170 *
171 * @return known accelerometer bias.
172 */
173 AccelerationTriad getBiasAsTriad();
174
175 /**
176 * Gets known accelerometer bias.
177 *
178 * @param result instance where result will be stored.
179 */
180 void getBiasAsTriad(final AccelerationTriad result);
181
182 /**
183 * Sets known accelerometer bias.
184 *
185 * @param bias accelerometer bias to be set.
186 * @throws LockedException if calibrator is currently running.
187 */
188 void setBias(final AccelerationTriad bias) throws LockedException;
189
190 /**
191 * Gets known accelerometer bias as an array.
192 * Array values are expressed in meters per squared second (m/s^2).
193 *
194 * @return array containing coordinates of known bias.
195 */
196 double[] getBias();
197
198 /**
199 * Gets known accelerometer bias as an array.
200 * Array values are expressed in meters per squared second (m/s^2).
201 *
202 * @param result instance where result data will be copied to.
203 * @throws IllegalArgumentException if provided array does not have length 3.
204 */
205 void getBias(final double[] result);
206
207 /**
208 * Sets known accelerometer bias as an array.
209 * Array values are expressed in meters per squared second (m/s^2).
210 *
211 * @param bias known accelerometer bias.
212 * @throws LockedException if calibrator is currently running.
213 * @throws IllegalArgumentException if provided array does not have length 3.
214 */
215 void setBias(final double[] bias) throws LockedException;
216
217 /**
218 * Gets known accelerometer bias as a column matrix.
219 *
220 * @return known accelerometer bias as a column matrix.
221 */
222 Matrix getBiasAsMatrix();
223
224 /**
225 * Gets known accelerometer bias as a column matrix.
226 *
227 * @param result instance where result data will be copied to.
228 * @throws IllegalArgumentException if provided matrix is not 3x1.
229 */
230 void getBiasAsMatrix(final Matrix result);
231
232 /**
233 * Sets known accelerometer bias as a column matrix.
234 *
235 * @param bias accelerometer bias to be set.
236 * @throws LockedException if calibrator is currently running.
237 * @throws IllegalArgumentException if provided matrix is not 3x1.
238 */
239 void setBias(final Matrix bias) throws LockedException;
240 }