1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.irurueta.navigation.inertial.calibration;
17
18 import com.irurueta.navigation.NotReadyException;
19 import com.irurueta.navigation.inertial.INSLooselyCoupledKalmanInitializerConfig;
20
21
22
23
24
25
26
27
28 public class INSLooselyCoupledKalmanInitializerConfigCreator {
29
30
31
32
33 private AccelerometerBiasUncertaintySource accelerometerBiasUncertaintySource;
34
35
36
37
38 private GyroscopeBiasUncertaintySource gyroscopeBiasUncertaintySource;
39
40
41
42
43 private AttitudeUncertaintySource attitudeUncertaintySource;
44
45
46
47
48 private VelocityUncertaintySource velocityUncertaintySource;
49
50
51
52
53 private PositionUncertaintySource positionUncertaintySource;
54
55
56
57
58 public INSLooselyCoupledKalmanInitializerConfigCreator() {
59 }
60
61
62
63
64
65
66
67
68
69
70 public INSLooselyCoupledKalmanInitializerConfigCreator(
71 final AccelerometerBiasUncertaintySource accelerometerBiasUncertaintySource,
72 final GyroscopeBiasUncertaintySource gyroscopeBiasUncertaintySource,
73 final AttitudeUncertaintySource attitudeUncertaintySource,
74 final VelocityUncertaintySource velocityUncertaintySource,
75 final PositionUncertaintySource positionUncertaintySource) {
76 this.accelerometerBiasUncertaintySource = accelerometerBiasUncertaintySource;
77 this.gyroscopeBiasUncertaintySource = gyroscopeBiasUncertaintySource;
78 this.attitudeUncertaintySource = attitudeUncertaintySource;
79 this.velocityUncertaintySource = velocityUncertaintySource;
80 this.positionUncertaintySource = positionUncertaintySource;
81 }
82
83
84
85
86
87
88
89
90 public INSLooselyCoupledKalmanInitializerConfigCreator(
91 final AccelerometerBiasUncertaintySource accelerometerBiasUncertaintySource,
92 final GyroscopeBiasUncertaintySource gyroscopeBiasUncertaintySource,
93 final RandomWalkEstimator randomWalkEstimator) {
94 this(accelerometerBiasUncertaintySource, gyroscopeBiasUncertaintySource, randomWalkEstimator,
95 randomWalkEstimator, randomWalkEstimator);
96 }
97
98
99
100
101
102
103 public AccelerometerBiasUncertaintySource getAccelerometerBiasUncertaintySource() {
104 return accelerometerBiasUncertaintySource;
105 }
106
107
108
109
110
111
112 public void setAccelerometerBiasUncertaintySource(
113 final AccelerometerBiasUncertaintySource accelerometerBiasUncertaintySource) {
114 this.accelerometerBiasUncertaintySource = accelerometerBiasUncertaintySource;
115 }
116
117
118
119
120
121
122 public GyroscopeBiasUncertaintySource getGyroscopeBiasUncertaintySource() {
123 return gyroscopeBiasUncertaintySource;
124 }
125
126
127
128
129
130
131 public void setGyroscopeBiasUncertaintySource(final GyroscopeBiasUncertaintySource gyroscopeBiasUncertaintySource) {
132 this.gyroscopeBiasUncertaintySource = gyroscopeBiasUncertaintySource;
133 }
134
135
136
137
138
139
140 public AttitudeUncertaintySource getAttitudeUncertaintySource() {
141 return attitudeUncertaintySource;
142 }
143
144
145
146
147
148
149 public void setAttitudeUncertaintySource(final AttitudeUncertaintySource attitudeUncertaintySource) {
150 this.attitudeUncertaintySource = attitudeUncertaintySource;
151 }
152
153
154
155
156
157
158 public VelocityUncertaintySource getVelocityUncertaintySource() {
159 return velocityUncertaintySource;
160 }
161
162
163
164
165
166
167 public void setVelocityUncertaintySource(final VelocityUncertaintySource velocityUncertaintySource) {
168 this.velocityUncertaintySource = velocityUncertaintySource;
169 }
170
171
172
173
174
175
176 public PositionUncertaintySource getPositionUncertaintySource() {
177 return positionUncertaintySource;
178 }
179
180
181
182
183
184
185 public void setPositionUncertaintySource(final PositionUncertaintySource positionUncertaintySource) {
186 this.positionUncertaintySource = positionUncertaintySource;
187 }
188
189
190
191
192
193
194
195 public boolean isReady() {
196 return accelerometerBiasUncertaintySource != null
197 && accelerometerBiasUncertaintySource.getEstimatedBiasStandardDeviationNorm() != null
198 && gyroscopeBiasUncertaintySource != null
199 && gyroscopeBiasUncertaintySource.getEstimatedBiasStandardDeviationNorm() != null
200 && attitudeUncertaintySource != null
201 && velocityUncertaintySource != null
202 && positionUncertaintySource != null;
203 }
204
205
206
207
208
209
210
211
212 public INSLooselyCoupledKalmanInitializerConfig create() throws NotReadyException {
213 if (!isReady()) {
214 throw new NotReadyException();
215 }
216
217 final var attitudeUncertainty = attitudeUncertaintySource.getAttitudeUncertainty();
218 final var velocityUncertainty = velocityUncertaintySource.getVelocityUncertainty();
219 final var positionUncertainty = positionUncertaintySource.getPositionUncertainty();
220 final var accelerationBiasUncertainty =
221 accelerometerBiasUncertaintySource.getEstimatedBiasStandardDeviationNorm();
222 final var gyroBiasUncertainty = gyroscopeBiasUncertaintySource.getEstimatedBiasStandardDeviationNorm();
223
224 return new INSLooselyCoupledKalmanInitializerConfig(attitudeUncertainty, velocityUncertainty,
225 positionUncertainty, accelerationBiasUncertainty, gyroBiasUncertainty);
226 }
227 }