1 /*
2 * Copyright (C) 2020 Alberto Irurueta Carro (alberto@irurueta.com)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.irurueta.navigation.inertial.calibration.gyroscope;
17
18 import com.irurueta.algebra.Matrix;
19 import com.irurueta.navigation.LockedException;
20 import com.irurueta.units.AngularSpeed;
21
22 /**
23 * Interface for gyroscope calibrator where bias is known.
24 */
25 public interface KnownBiasGyroscopeCalibrator {
26
27 /**
28 * Gets known x coordinate of gyroscope bias expressed in radians per second
29 * (rad/s).
30 *
31 * @return x coordinate of gyroscope bias.
32 */
33 double getBiasX();
34
35 /**
36 * Sets known x coordinate of gyroscope bias expressed in radians per second
37 * (rad/s).
38 *
39 * @param biasX x coordinate of gyroscope bias.
40 * @throws LockedException if calibrator is currently running.
41 */
42 void setBiasX(final double biasX) throws LockedException;
43
44 /**
45 * Gets known y coordinate of gyroscope bias expressed in radians per second
46 * (rad/s).
47 *
48 * @return y coordinate of gyroscope bias.
49 */
50 double getBiasY();
51
52 /**
53 * Sets known y coordinate of gyroscope bias expressed in radians per second
54 * (rad/s).
55 *
56 * @param biasY y coordinate of gyroscope bias.
57 * @throws LockedException if calibrator is currently running.
58 */
59 void setBiasY(final double biasY) throws LockedException;
60
61 /**
62 * Gets known z coordinate of gyroscope bias expressed in radians per second
63 * (rad/s).
64 *
65 * @return z coordinate of gyroscope bias.
66 */
67 double getBiasZ();
68
69 /**
70 * Sets known z coordinate of gyroscope bias expressed in radians per second
71 * (rad/s).
72 *
73 * @param biasZ z coordinate of gyroscope bias.
74 * @throws LockedException if calibrator is currently running.
75 */
76 void setBiasZ(final double biasZ) throws LockedException;
77
78 /**
79 * Gets known x coordinate of gyroscope bias.
80 *
81 * @return x coordinate of gyroscope bias.
82 */
83 AngularSpeed getBiasAngularSpeedX();
84
85 /**
86 * Gets known x coordinate of gyroscope bias.
87 *
88 * @param result instance where result data will be stored.
89 */
90 void getBiasAngularSpeedX(final AngularSpeed result);
91
92 /**
93 * Sets known x coordinate of gyroscope bias.
94 *
95 * @param biasX x coordinate of gyroscope bias.
96 * @throws LockedException if calibrator is currently running.
97 */
98 void setBiasX(final AngularSpeed biasX) throws LockedException;
99
100 /**
101 * Gets known y coordinate of gyroscope bias.
102 *
103 * @return y coordinate of gyroscope bias.
104 */
105 AngularSpeed getBiasAngularSpeedY();
106
107 /**
108 * Gets known y coordinate of gyroscope bias.
109 *
110 * @param result instance where result data will be stored.
111 */
112 void getBiasAngularSpeedY(final AngularSpeed result);
113
114 /**
115 * Sets known y coordinate of gyroscope bias.
116 *
117 * @param biasY y coordinate of gyroscope bias.
118 * @throws LockedException if calibrator is currently running.
119 */
120 void setBiasY(final AngularSpeed biasY) throws LockedException;
121
122 /**
123 * Gets known z coordinate of gyroscope bias.
124 *
125 * @return z coordinate of gyroscope bias.
126 */
127 AngularSpeed getBiasAngularSpeedZ();
128
129 /**
130 * Gets known z coordinate of gyroscope bias.
131 *
132 * @param result instance where result data will be stored.
133 */
134 void getBiasAngularSpeedZ(final AngularSpeed result);
135
136 /**
137 * Sets known z coordinate of gyroscope bias.
138 *
139 * @param biasZ z coordinate of gyroscope bias.
140 * @throws LockedException if calibrator is currently running.
141 */
142 void setBiasZ(final AngularSpeed biasZ) throws LockedException;
143
144 /**
145 * Sets known gyroscope bias coordinates expressed in radians per second
146 * (rad/s).
147 *
148 * @param biasX x coordinate of gyroscope bias.
149 * @param biasY y coordinate of gyroscope bias.
150 * @param biasZ z coordinate of gyroscope bias.
151 * @throws LockedException if calibrator is currently running.
152 */
153 void setBiasCoordinates(final double biasX, final double biasY, final double biasZ) throws LockedException;
154
155 /**
156 * Sets known gyroscope bias coordinates.
157 *
158 * @param biasX x coordinate of gyroscope bias.
159 * @param biasY y coordinate of gyroscope bias.
160 * @param biasZ z coordinate of gyroscope bias.
161 * @throws LockedException if calibrator is currently running.
162 */
163 void setBiasCoordinates(final AngularSpeed biasX, final AngularSpeed biasY, final AngularSpeed biasZ)
164 throws LockedException;
165
166 /**
167 * Gets known gyroscope bias as an array.
168 * Array values are expressed in radians per second (rad/s).
169 *
170 * @return array containing coordinate of known bias.
171 */
172 double[] getBias();
173
174 /**
175 * Gets known gyroscope bias as an array.
176 * Array values are expressed in radians per second (rad/s).
177 *
178 * @param result instance where result data will be copied to.
179 * @throws IllegalArgumentException if provided array does not have length 3.
180 */
181 void getBias(final double[] result);
182
183 /**
184 * Sets known gyroscope bias as an array.
185 * Array values are expressed in radians per second (rad/s).
186 *
187 * @param bias known gyroscope bias.
188 * @throws LockedException if calibrator is currently running.
189 * @throws IllegalArgumentException if provided array does not have length 3.
190 */
191 void setBias(final double[] bias) throws LockedException;
192
193 /**
194 * Gets known gyroscope bias as a column matrix.
195 *
196 * @return known gyroscope bias as a column matrix.
197 */
198 Matrix getBiasAsMatrix();
199
200 /**
201 * Gets known gyroscope bias as a column matrix.
202 *
203 * @param result instance where result data will be copied to.
204 * @throws IllegalArgumentException if provided matrix is not 3x1.
205 */
206 void getBiasAsMatrix(final Matrix result);
207
208 /**
209 * Sets known gyroscope bias as a column matrix.
210 *
211 * @param bias gyroscope bias to be set.
212 * @throws LockedException if calibrator is currently running.
213 * @throws IllegalArgumentException if provided matrix is not 3x1.
214 */
215 void setBias(final Matrix bias) throws LockedException;
216 }