Skyward boardcore
Loading...
Searching...
No Matches
NAS.cpp
Go to the documentation of this file.
1/* Copyright (c) 2020-2022 Skyward Experimental Rocketry
2 * Authors: Alessandro Del Duca, Luca Conterio, Marco Cella
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#include "NAS.h"
24
26#include <math.h>
28
29#include <iostream>
30
31using namespace Boardcore;
32using namespace Eigen;
33
34namespace Boardcore
35{
36
37NAS::NAS(const NASConfig& config) : config(config)
38{
39 // Covariance setup
41
42 // Utility matrixes
43 R_acc << config.SIGMA_ACC * config.SIGMA_ACC * Matrix3f::Identity();
44 R_mag << config.SIGMA_MAG * config.SIGMA_MAG * Matrix3f::Identity();
45 {
46 // clang-format off
47 Q_quat << (config.SIGMA_W * config.SIGMA_W * config.T + (1.0f / 3.0f) * config.SIGMA_BETA * config.SIGMA_BETA * config.T * config.T * config.T) * Matrix3f::Identity(),
48 (0.5f * config.SIGMA_BETA * config.SIGMA_BETA * config.T * config.T) * Matrix3f::Identity(),
49 (0.5f * config.SIGMA_BETA * config.SIGMA_BETA * config.T * config.T) * Matrix3f::Identity(), // cppcheck-suppress constStatement
50 (config.SIGMA_BETA * config.SIGMA_BETA * config.T) * Matrix3f::Identity();
51 // clang-format on
52
53 Q_lin << config.SIGMA_POS * config.SIGMA_POS * Matrix3f::Identity(),
54 MatrixXf::Zero(3, 3),
55 // cppcheck-suppress constStatement
56 MatrixXf::Zero(3, 3),
57 config.SIGMA_VEL * config.SIGMA_VEL * Matrix3f::Identity();
58
59 F_lin = Matrix<float, 6, 6>::Identity();
60 F_lin.block<3, 3>(0, 3) = config.T * Matrix3f::Identity();
61 F_lin_tr = F_lin.transpose();
62
63 F_quat << -Matrix3f::Identity(), -Matrix3f::Identity() * config.T,
64 Matrix3f::Zero(3, 3), Matrix3f::Identity();
65 F_quat_tr = F_quat.transpose();
66
67 G_quat << -Matrix3f::Identity(), Matrix3f::Zero(3, 3),
68 Matrix3f::Zero(3, 3), Matrix3f::Identity();
69 G_quat_tr = G_quat.transpose();
70 }
71}
72
73void NAS::predictAcc(const Vector3f& acceleration)
74{
75 Matrix3f A = SkyQuaternion::quat2rotationMatrix(x.block<4, 1>(IDX_QUAT, 0));
76 Vector3f pos = x.block<3, 1>(IDX_POS, 0);
77 Vector3f vel = x.block<3, 1>(IDX_VEL, 0);
78
79 // Update position by integrating the velocity
80 pos = pos + vel * config.T;
81
82 // Measured acceleration in NED frame without gravity
83 Vector3f a = A * acceleration - gravityNed;
84
85 // Update velocity by integrating the acceleration
86 vel = vel + a * config.T;
87
88 // Save the updated state
89 x.block<3, 1>(IDX_POS, 0) = pos;
90 x.block<3, 1>(IDX_VEL, 0) = vel;
91
92 // Variance propagation
93 Matrix<float, 6, 6> Pl = P.block<6, 6>(0, 0);
94 P.block<6, 6>(0, 0) = F_lin * Pl * F_lin_tr + Q_lin;
95}
96
97void NAS::predictAcc(const AccelerometerData& acceleration)
98{
99 predictAcc(Vector3f{acceleration.accelerationX, acceleration.accelerationY,
100 acceleration.accelerationZ});
101}
102
103void NAS::predictGyro(const Vector3f& angularSpeed)
104{
105 Vector3f bias = x.block<3, 1>(IDX_BIAS, 0);
106 Vector4f q = x.block<4, 1>(IDX_QUAT, 0);
107
108 Vector3f omega = angularSpeed - bias;
109 // clang-format off
110 Matrix4f omega_mat{
111 { 0.0f, omega(2), -omega(1), omega(0)},
112 {-omega(2), 0.0f, omega(0), omega(1)},
113 { omega(1), -omega(0), 0.0f, omega(2)},
114 {-omega(0), -omega(1), -omega(2), 0.0f}
115 };
116 // clang-format on
117
118 // Update orientation by integrating the angular velocity
119 q = (Matrix4f::Identity() + 0.5F * omega_mat * config.T) * q;
120 q.normalize();
121
122 // Save the updated state
123 x.block<4, 1>(IDX_QUAT, 0) = q;
124
125 // Variance propagation
126 // TODO: Optimize last G_quat * Q_quat * G_att_tr
127 Matrix<float, 6, 6> Pq = P.block<6, 6>(IDX_QUAT, IDX_QUAT);
128 Pq = F_quat * Pq * F_quat_tr + G_quat * Q_quat * G_quat_tr;
129 P.block<6, 6>(IDX_QUAT, IDX_QUAT) = Pq;
130}
131
132void NAS::predictGyro(const GyroscopeData& angularSpeed)
133{
134 predictGyro(Vector3f{angularSpeed.angularSpeedX, angularSpeed.angularSpeedY,
135 angularSpeed.angularSpeedZ});
136}
137
138void NAS::correctBaro(const float pressure)
139{
140 float d = x(2);
141 float altitude = -d;
142
143 float temp = Aeroutils::relTemperature(altitude, reference.refTemperature);
144
145 Matrix<float, 1, 6> H = Matrix<float, 1, 6>::Zero();
146 float R = config.SIGMA_BAR * config.SIGMA_BAR;
147
148 // Compute gradient of the altitude-pressure function
149 H[2] = Constants::a * Constants::n * reference.refPressure *
150 powf(1 + Constants::a * d / temp, Constants::n - 1) / temp;
151
152 Matrix<float, 6, 6> Pl = P.block<6, 6>(0, 0);
153 float S = H * Pl * H.transpose() + R;
154
155 // If not invertible, don't do the correction and return
156 if (S < 1e-3)
157 return;
158
159 float y_hat =
160 Aeroutils::relPressure(reference.refAltitude - x(2),
161 reference.mslPressure, reference.mslTemperature);
162 Matrix<float, 1, 1> e = Matrix<float, 1, 1>(pressure - y_hat);
163 Matrix<float, 6, 1> K = Pl * H.transpose() / S;
164 P.block<6, 6>(0, 0) = (Matrix<float, 6, 6>::Identity() - K * H) * Pl;
165
166 // Update the state
167 x.head<6>() = x.head<6>() + K * e;
168}
169
170void NAS::correctGPS(const Vector4f& gps)
171{
172 // GPS
173 H_gps = Matrix<float, 4, 6>::Zero();
174
175 //
176 float angle_rad = (reference.refLatitude + x(0) / Constants::gpsLatConst) *
177 Constants::DEGREES_TO_RADIANS;
178
179 float H11 = 1 / Constants::gpsLatConst;
180 float H12 = 0;
181 float H21 = (x(1) * sin(angle_rad)) /
182 (Constants::gpsLatConst * Constants::gpsLonConst *
183 pow(cos(angle_rad), 2));
184 float H22 = 1 / (Constants::gpsLonConst * cos(angle_rad));
185
186 // Convert to millideg
187 H_gps.coeffRef(0, 0) = H11 * 1000;
188 H_gps.coeffRef(0, 1) = H12 * 1000;
189 H_gps.coeffRef(1, 0) = H21 * 1000;
190 H_gps.coeffRef(1, 1) = H22 * 1000;
191
192 H_gps.coeffRef(2, 3) = 1;
193 H_gps.coeffRef(3, 4) = 1;
194
195 H_gps_tr = H_gps.transpose();
196
197 Matrix<float, 1, 4> R_molt = {1, 1, std::max(std::abs(gps(2)), 30.0f),
198 std::max(std::abs(gps(3)), 30.0f)};
199 Matrix<float, 4, 4> R_gps = config.SIGMA_GPS.asDiagonal().toDenseMatrix() *
200 config.SIGMA_GPS.asDiagonal().toDenseMatrix() *
201 R_molt.asDiagonal().toDenseMatrix();
202
203 // Current state [n e vn ve]
204 float lat = x(0) / Constants::gpsLatConst + reference.refLatitude;
205 float lon = x(1) / (Constants::gpsLonConst *
206 cos(lat * Constants::DEGREES_TO_RADIANS)) +
207 reference.refLongitude;
208 Matrix<float, 4, 1> z{lat, lon, x(3), x(4)};
209 Vector4f e{(gps(0) - z(0)) * 1000.0f, (gps(1) - z(1)) * 1000.0f,
210 gps(2) - z(2), gps(3) - z(3)};
211
212 Matrix<float, 6, 6> Pl = P.block<6, 6>(0, 0);
213
214 Matrix<float, 4, 4> S = H_gps * Pl * H_gps_tr + R_gps;
215
216 // If not invertible, don't do the correction and return
217 if (S.determinant() < 1e-6)
218 return;
219
220 Matrix<float, 6, 4> K = Pl * H_gps_tr * S.inverse();
221
222 // Update the state
223 x.head<6>() = x.head<6>() + K * e;
224
225 P.block<6, 6>(0, 0) = (Matrix<float, 6, 6>::Identity() - K * H_gps) * Pl;
226}
227
228void NAS::correctGPS(const GPSData& gps)
229{
230 if (gps.fix != 3)
231 return;
232
233 correctGPS(Vector4f{gps.latitude, gps.longitude, gps.velocityNorth,
234 gps.velocityEast});
235}
236
237void NAS::correctMag(const Vector3f& mag)
238{
239 Vector4f q = x.block<4, 1>(IDX_QUAT, 0);
240 Matrix3f A = SkyQuaternion::quat2rotationMatrix(q).transpose();
241
242 // Rotate the NED magnetic field in the relative reference frame
243 Vector3f mEst = A * config.NED_MAG;
244
245 // clang-format off
246 Matrix3f M{
247 { 0, -mEst(2), mEst(1)},
248 { mEst(2), 0, -mEst(0)},
249 {-mEst(1), mEst(0), 0}
250 };
251 // clang-format on
252
253 Matrix<float, 3, 6> H;
254 H << M, Matrix3f::Zero(3, 3);
255 Matrix<float, 6, 6> Pq = P.block<6, 6>(IDX_QUAT, IDX_QUAT);
256 Matrix<float, 3, 3> S = H * Pq * H.transpose() + R_mag;
257
258 Matrix<float, 6, 3> K = Pq * H.transpose() * S.inverse();
259 Matrix<float, 6, 1> dx = K * (mag - mEst);
260 Vector4f r{0.5f * dx(0), 0.5f * dx(1), 0.5f * dx(2),
261 sqrtf(1.0f - 0.25f * dx.head<3>().squaredNorm())};
262
263 x.block<4, 1>(IDX_QUAT, 0) = SkyQuaternion::quatProd(r, q);
264 x.block<3, 1>(IDX_BIAS, 0) += dx.tail<3>();
265 Matrix<float, 6, 6> tmp = Matrix<float, 6, 6>::Identity() - K * H;
266 Pq = tmp * Pq * tmp.transpose() + K * R_mag * K.transpose();
267 P.block<6, 6>(IDX_QUAT, IDX_QUAT) = Pq;
268}
269
271{
272 Vector3f magV = {mag.magneticFieldX, mag.magneticFieldY,
273 mag.magneticFieldZ};
274 correctMag(magV.normalized());
275}
276
277void NAS::correctAcc(const Vector3f& acc)
278{
279 Vector4f q = x.block<4, 1>(IDX_QUAT, 0);
280 Matrix3f A = SkyQuaternion::quat2rotationMatrix(q).transpose();
281
282 // Rotate the NED magnetic field in the relative reference frame
283 Vector3f aEst = A * gravityNed;
284 aEst.normalize();
285
286 // Gradient matrix
287 // clang-format off
288 Matrix3f M{
289 { 0, -aEst(2), aEst(1)},
290 { aEst(2), 0, -aEst(0)},
291 {-aEst(1), aEst(0), 0}
292 };
293 // clang-format on
294
295 Matrix<float, 3, 6> H;
296 H << M, Matrix3f::Zero(3, 3);
297 Matrix<float, 6, 6> Pq = P.block<6, 6>(IDX_QUAT, IDX_QUAT);
298 Matrix<float, 3, 3> S = H * Pq * H.transpose() + R_acc;
299
300 Matrix<float, 6, 3> K = Pq * H.transpose() * S.inverse();
301 Matrix<float, 6, 1> dx = K * (acc - aEst);
302 Vector4f r{0.5f * dx(0), 0.5f * dx(1), 0.5f * dx(2),
303 sqrtf(1.0f - 0.25f * dx.head<3>().squaredNorm())};
304
305 x.block<4, 1>(IDX_QUAT, 0) = SkyQuaternion::quatProd(r, q);
306 x.block<3, 1>(IDX_BIAS, 0) += dx.tail<3>();
307 Matrix<float, 6, 6> tmp = Matrix<float, 6, 6>::Identity() - K * H;
308 Pq = tmp * Pq * tmp.transpose() + K * R_mag * K.transpose();
309 P.block<6, 6>(IDX_QUAT, IDX_QUAT) = Pq;
310}
311
313{
314 Vector3f accV = {acc.accelerationX, acc.accelerationY, acc.accelerationZ};
315 correctAcc(accV.normalized());
316}
317
318void NAS::correctPitot(const float staticPressure, const float dynamicPressure)
319{
320 using namespace Constants;
321
322 // Retrieve all necessary parameters
323 const float P0 = reference.refPressure; // Reference pressure
324 const float T0 = reference.refTemperature; // Reference temperature
325 const float d =
326 x(2) - reference.refAltitude; // msl Down altitude from state
327 const float qx = x(6); // x quaternion from state
328 const float qy = x(7); // y quaternion from state
329 const float qz = x(8); // z quaternion from state
330 const float qw = x(9); // Scalar quaternion from state
331 Vector3f vel = x.block<IDX_VEL, 1>(3, 0); // NED Velocity from state
332
333 // Temperature at current altitude
334 const float T = T0 + a * d;
335
336 // Rotation vector from NED to Body frame
337 RowVector3f rot_NB;
338 // clang-format off
339 rot_NB << qw * qw + qx * qx - qy * qy - qz * qz,
340 // cppcheck-suppress constStatement
341 2 * (qx * qy + qw * qz),
342 2 * (qx * qz - qw * qy);
343 // clang-format on
344
345 // X Velocity in body frame
346 const float vbody_x = rot_NB * vel;
347
348 // Derivative of 1/T wrt states
349 Matrix<float, 1, 12> dT = Matrix<float, 1, 12>::Zero();
350 dT(2) = -a / powf(T0 + a * d, 2);
351
352 // Derivative of Static Pressure wrt states
353 Matrix<float, 1, 12> dPstat = Matrix<float, 1, 12>::Zero();
354 dPstat(2) = g * P0 / (R * T0) * powf(1 - a * d / T0, -g / (a * R) - 1);
355
356 // clang-format off
357 // Derivative of Quaternions wrt states (using error angles approximation)
358 Matrix<float, 4, 3> dQuat;
359 dQuat << qw, -qz, qy, qz,
360 qw, -qx, -qy, qx,
361 // cppcheck-suppress constStatement
362 qw, -qx, qy, qw;
363
364 // Derivative of Rotation vector from NED to Body frame wrt quaternions
365 Matrix<float, 3, 4> dRot_dQuat;
366 dRot_dQuat << qx, -qy, -qz, qw,
367 qy, qx, qw, qz,
368 // cppcheck-suppress constStatement
369 qz, -qw, qx, -qy;
370 // clang-format on
371
372 // Derivative of Rotation vector from NED to Body frame wrt states
373 Matrix<float, 12, 3> dRot = Matrix<float, 12, 3>::Zero();
374 dRot.block<3, 3>(IDX_QUAT, 0) = dRot_dQuat * dQuat;
375
376 // Derivative of velocity wrt states
377 Matrix<float, 3, 12> dVel = Matrix<float, 3, 12>::Zero();
378 dVel.block<3, 3>(IDX_VEL, 0) = Matrix3f::Identity();
379
380 // Derivative of Velocity in Body frame wrt states
381 Vector<float, 12> dVbody =
382 dRot * vel + dVel.transpose() * rot_NB.transpose();
383
384 // Estimated static pressure
385 const float Ps_est = P0 * powf(1 + a * d / T0, g / (a * R));
386
387 // Estimated Mach squared
388 const float M2 = vbody_x * vbody_x / (GAMMA_AIR * R * T);
389
390 // Estimated dynamic pressure
391 const float Pd_est =
392 Ps_est *
393 (powf(1 + (GAMMA_AIR - 1) / 2 * M2, GAMMA_AIR / (GAMMA_AIR - 1)) - 1);
394
395 // Alpha-term
396 const float alpha =
397 (1 + (GAMMA_AIR - 1) / 2 * vbody_x * vbody_x / (GAMMA_AIR * R * T));
398
399 // Derivative of alpha wrt velocity
400 Matrix<float, 1, 12> dalpha_vel = 2 * vbody_x * (GAMMA_AIR - 1) /
401 (2 * GAMMA_AIR * R * T) *
402 dVbody.transpose();
403
404 // Derivative of alpha wrt temperature
405 Matrix<float, 1, 12> dalpha_temp =
406 (GAMMA_AIR - 1) * vbody_x * vbody_x / (2 * GAMMA_AIR * R) * dT;
407
408 // Derivative of Alpha wrt states
409 Matrix<float, 1, 12> dalpha = dalpha_vel + dalpha_temp;
410
411 // Beta term
412 const float beta = powf(alpha, GAMMA_AIR / (GAMMA_AIR - 1));
413
414 // Derivative of Beta wrt states
415 Matrix<float, 1, 12> dbeta = GAMMA_AIR / (GAMMA_AIR - 1) *
416 powf(alpha, GAMMA_AIR / (GAMMA_AIR - 1) - 1) *
417 dalpha;
418
419 // Total pressure derivative wrt states
420 Matrix<float, 1, 12> dPtot = beta * dPstat + Ps_est * dbeta;
421
422 // Dynamic pressure derivative wrt states
423 Matrix<float, 1, 12> dPdyn = dPtot - dPstat;
424
425 // Define H matrix
426 Matrix<float, 2, 12> H;
427 // cppcheck-suppress constStatement
428 H << dPstat, dPdyn;
429
430 // If a nan is generated don't do the correction
431 if (H.array().isNaN().any())
432 return;
433
434 // Covariance matrix of measurement noise
435 Matrix2f R_mat = Matrix2f::Zero();
436 R_mat(0, 0) = config.SIGMA_PITOT_STATIC * config.SIGMA_PITOT_STATIC;
437 R_mat(1, 1) = config.SIGMA_PITOT_DYNAMIC * config.SIGMA_PITOT_DYNAMIC;
438
439 Matrix2f S = H * P * H.transpose() + R_mat;
440
441 // If not invertible, don't do the correction and return
442 if (S.determinant() < 1e-3)
443 return;
444
445 // Measurement error
446 Vector2f e =
447 (Vector2f() << staticPressure - Ps_est, dynamicPressure - Pd_est)
448 .finished();
449
450 // Kalman gain
451 Matrix<float, 12, 2> K = P * H.transpose() * S.inverse();
452
453 // Define state correction
454 Matrix<float, 13, 1> correction = Matrix<float, 13, 1>::Zero();
455 correction.block<6, 1>(IDX_POS, 0) = (K * e).block<6, 1>(IDX_POS, 0);
456
457 // Update the state
458 x = x + correction;
459
460 // Update covariance matrix
461 P = (Matrix<float, 12, 12>::Identity() - K * H) * P;
462}
463
468
469Matrix<float, 13, 1> NAS::getX() const { return x; }
470
471void NAS::setState(const NASState& state) { this->x = state.getX(); }
472
473void NAS::setX(const Matrix<float, 13, 1>& x) { this->x = x; }
474
476{
477 this->reference = reference;
478}
479
481
483{
484 // clang-format off
485 Matrix3f P_pos{
486 {config.P_POS, 0, 0},
487 {0, config.P_POS, 0},
488 {0, 0, config.P_POS_VERTICAL}
489 };
490 Matrix3f P_vel{
491 {config.P_VEL, 0, 0},
492 {0, config.P_VEL, 0},
493 {0, 0, config.P_VEL_VERTICAL}
494 };
495 Matrix3f P_att = Matrix3f::Identity() * config.P_ATT;
496 Matrix3f P_bias = Matrix3f::Identity() * config.P_BIAS;
497 P << P_pos, MatrixXf::Zero(3, 9),
498 MatrixXf::Zero(3, 3), P_vel, MatrixXf::Zero(3, 6),
499 MatrixXf::Zero(3, 6), P_att, MatrixXf::Zero(3, 3),
500 MatrixXf::Zero(3, 9), P_bias; // cppcheck-suppress constStatement
501 // clang-format on
502}
503
504} // namespace Boardcore
void predictGyro(const Eigen::Vector3f &angularSpeed)
Prediction with gyroscope data.
void correctPitot(const float staticPressure, const float dynamicPressure)
Correction with pitot pressures.
Definition NAS.cpp:318
Eigen::Matrix< float, 13, 1 > getX() const
Definition NAS.cpp:469
void resetCovariance()
Resets the covariance matrix to the initial state based on the configuration.
Definition NAS.cpp:482
void predictAcc(const Eigen::Vector3f &acceleration)
Prediction with accelerometer data.
static constexpr uint16_t IDX_BIAS
Definition NAS.h:51
NASState getState() const
Definition NAS.cpp:464
void correctAcc(const Eigen::Vector3f &acc)
Correction with accelerometer data.
void correctMag(const Eigen::Vector3f &mag)
Correction with magnetometer data.
void setState(const NASState &state)
Definition NAS.cpp:471
NAS(const NASConfig &config)
Definition NAS.cpp:37
static constexpr uint16_t IDX_POS
< Index of position elements in the state.
Definition NAS.h:42
void correctGPS(const Eigen::Vector4f &gps)
Correction with gps data.
void setReferenceValues(const ReferenceValues &reference)
Changes the reference values.
Definition NAS.cpp:475
void correctBaro(const float pressure)
Correction with barometer data.
Definition NAS.cpp:138
static constexpr uint16_t IDX_VEL
Index of quaternions elements in the state.
Definition NAS.h:45
ReferenceValues getReferenceValues()
Returns the current reference values.
Definition NAS.cpp:480
static constexpr uint16_t IDX_QUAT
Index of bias elements in the state.
Definition NAS.h:48
void setX(const Eigen::Matrix< float, 13, 1 > &x)
Definition NAS.cpp:473
float relPressure(float altitude, float pressureRef, float temperatureRef)
Returns the pressure given the altitude with respect to a reference pressure and temperature,...
Definition AeroUtils.cpp:41
float relTemperature(float altitude, float temperatureRef)
Returns the temperature at the given altitude with respect to the reference temperature.
Definition AeroUtils.cpp:46
Matrix3f quat2rotationMatrix(const Vector4f &q)
Vector4f quatProd(const Vector4f &q1, const Vector4f &q2)
uint64_t getTimestamp()
Returns the current timer value in microseconds.
Driver for the VN100S IMU.
Structure to handle accelerometer data.
Definition SensorData.h:119
Structure to handle GPS data.
Definition SensorData.h:277
Structure to handle gyroscope data.
Definition SensorData.h:199
Structure to handle magnetometer data.
Definition SensorData.h:238
float T
[s] Sample period
Definition NASConfig.h:32
float SIGMA_ACC
[m/s^2] Estimated accelerometer variance
Definition NASConfig.h:35
Eigen::Vector4f SIGMA_GPS
Definition NASConfig.h:37
float SIGMA_POS
[m] Estimated variance of the position noise
Definition NASConfig.h:41
float P_ATT
Attitude prediction covariance.
Definition NASConfig.h:54
float P_POS
Position prediction covariance horizontal.
Definition NASConfig.h:48
float SIGMA_BETA
[rad/s^2] Estimated gyroscope bias variance
Definition NASConfig.h:33
float P_BIAS
Bias prediction covariance.
Definition NASConfig.h:55
Eigen::Vector3f NED_MAG
Normalized magnetic field vector in NED frame.
Definition NASConfig.h:59
float SIGMA_W
[rad] Estimated gyroscope variance
Definition NASConfig.h:34
float P_POS_VERTICAL
Position prediction covariance vertical.
Definition NASConfig.h:49
float SIGMA_VEL
[m/s] Estimated variance of the velocity noise
Definition NASConfig.h:42
float SIGMA_MAG
[uT] Estimated magnetometer variance
Definition NASConfig.h:36
float P_VEL
Velocity prediction covariance horizontal.
Definition NASConfig.h:51
float SIGMA_BAR
[Pa] Estimated altitude variance
Definition NASConfig.h:40
float P_VEL_VERTICAL
Velocity prediction covariance vertical.
Definition NASConfig.h:52
Eigen::Matrix< float, 13, 1 > getX() const
Definition NASState.h:67
Reference values for the Apogee Detection Algorithm.