45 #include <mathlib/mathlib.h> 51 float optflow_test_ratio[2] = {0};
67 float H_LOS[2][24] = {};
84 Vector3f vel_body = earth_to_body * vel_rel_earth;
94 heightAboveGndEst -= pos_offset_earth(2);
97 heightAboveGndEst =
math::max(heightAboveGndEst, gndclearance);
100 float range = heightAboveGndEst / earth_to_body(2, 2);
110 _flow_innov[0] = vel_body(1) / range - opt_flow_rate(0);
111 _flow_innov[1] = -vel_body(0) / range - opt_flow_rate(1);
120 for (uint8_t obs_index = 0; obs_index <= 1; obs_index++) {
122 if (obs_index == 0) {
125 float t2 = 1.0f / range;
126 H_LOS[0][0] = t2*(q1*vd*2.0f+q0*ve*2.0f-q3*vn*2.0f);
127 H_LOS[0][1] = t2*(q0*vd*2.0f-q1*ve*2.0f+q2*vn*2.0f);
128 H_LOS[0][2] = t2*(q3*vd*2.0f+q2*ve*2.0f+q1*vn*2.0f);
129 H_LOS[0][3] = -t2*(q2*vd*-2.0f+q3*ve*2.0f+q0*vn*2.0f);
130 H_LOS[0][4] = -t2*(q0*q3*2.0f-q1*q2*2.0f);
131 H_LOS[0][5] = t2*(q0*q0-q1*q1+q2*q2-q3*q3);
132 H_LOS[0][6] = t2*(q0*q1*2.0f+q2*q3*2.0f);
135 float t3 = q1*vd*2.0f;
136 float t4 = q0*ve*2.0f;
137 float t11 = q3*vn*2.0f;
138 float t5 = t3+t4-
t11;
139 float t6 = q0*q3*2.0f;
140 float t29 = q1*q2*2.0f;
142 float t8 = q0*q1*2.0f;
143 float t9 = q2*q3*2.0f;
145 float t12 =
P[0][0]*t2*
t5;
146 float t13 = q0*vd*2.0f;
147 float t14 = q2*vn*2.0f;
148 float t28 = q1*ve*2.0f;
150 float t16 = q3*vd*2.0f;
151 float t17 = q2*ve*2.0f;
152 float t18 = q1*vn*2.0f;
154 float t20 = q3*ve*2.0f;
155 float t21 = q0*vn*2.0f;
156 float t30 = q2*vd*2.0f;
162 float t27 = t23-t24+t25-
t26;
168 float t79 =
P[4][0]*t2*
t7;
170 float t36 = t12+t32+t33+t34+t35-t79-
t80;
173 float t39 =
P[0][1]*t2*
t5;
176 float t81 =
P[4][1]*t2*
t7;
178 float t42 = t31+t38+t39+t40+t41-t81-
t82;
181 float t45 =
P[0][2]*t2*
t5;
185 float t83 =
P[4][2]*t2*
t7;
187 float t49 = t44+t45+t46+t47+t48-t83-
t84;
190 float t52 =
P[0][3]*t2*
t5;
194 float t85 =
P[4][3]*t2*
t7;
196 float t56 = t51+t52+t53+t54+t55-t85-
t86;
198 float t58 =
P[0][5]*t2*
t5;
202 float t88 =
P[4][5]*t2*
t7;
204 float t62 = t57+t58+t59+t60+t61-t88-
t89;
207 float t65 =
P[0][4]*t2*
t5;
211 float t90 =
P[4][4]*t2*
t7;
213 float t69 = t64+t65+t66+t67+t68-t90-
t91;
215 float t71 =
P[0][6]*t2*
t5;
219 float t93 =
P[4][6]*t2*
t7;
221 float t75 = t70+t71+t72+t73+t74-t93-
t94;
225 float t77 = R_LOS+t37+t43+t50+t63+t76-t87-
t92;
240 Kfusion[0][0] = t78*(t12-
P[0][4]*t2*t7+
P[0][1]*t2*t15+
P[0][6]*t2*t10+
P[0][2]*t2*t19-
P[0][3]*t2*t22+
P[0][5]*t2*
t27);
241 Kfusion[1][0] = t78*(t31+
P[1][0]*t2*t5-
P[1][4]*t2*t7+
P[1][6]*t2*t10+
P[1][2]*t2*t19-
P[1][3]*t2*t22+
P[1][5]*t2*
t27);
242 Kfusion[2][0] = t78*(t47+
P[2][0]*t2*t5-
P[2][4]*t2*t7+
P[2][1]*t2*t15+
P[2][6]*t2*t10-
P[2][3]*t2*t22+
P[2][5]*t2*
t27);
243 Kfusion[3][0] = t78*(-t86+
P[3][0]*t2*t5-
P[3][4]*t2*t7+
P[3][1]*t2*t15+
P[3][6]*t2*t10+
P[3][2]*t2*t19+
P[3][5]*t2*
t27);
244 Kfusion[4][0] = t78*(-t90+
P[4][0]*t2*t5+
P[4][1]*t2*t15+
P[4][6]*t2*t10+
P[4][2]*t2*t19-
P[4][3]*t2*t22+
P[4][5]*t2*
t27);
245 Kfusion[5][0] = t78*(t61+
P[5][0]*t2*t5-
P[5][4]*t2*t7+
P[5][1]*t2*t15+
P[5][6]*t2*t10+
P[5][2]*t2*t19-
P[5][3]*t2*
t22);
246 Kfusion[6][0] = t78*(t70+
P[6][0]*t2*t5-
P[6][4]*t2*t7+
P[6][1]*t2*t15+
P[6][2]*t2*t19-
P[6][3]*t2*t22+
P[6][5]*t2*
t27);
247 Kfusion[7][0] = t78*(
P[7][0]*t2*t5-
P[7][4]*t2*t7+
P[7][1]*t2*t15+
P[7][6]*t2*t10+
P[7][2]*t2*t19-
P[7][3]*t2*t22+
P[7][5]*t2*
t27);
248 Kfusion[8][0] = t78*(
P[8][0]*t2*t5-
P[8][4]*t2*t7+
P[8][1]*t2*t15+
P[8][6]*t2*t10+
P[8][2]*t2*t19-
P[8][3]*t2*t22+
P[8][5]*t2*
t27);
249 Kfusion[9][0] = t78*(
P[9][0]*t2*t5-
P[9][4]*t2*t7+
P[9][1]*t2*t15+
P[9][6]*t2*t10+
P[9][2]*t2*t19-
P[9][3]*t2*t22+
P[9][5]*t2*
t27);
250 Kfusion[10][0] = t78*(
P[10][0]*t2*t5-
P[10][4]*t2*t7+
P[10][1]*t2*t15+
P[10][6]*t2*t10+
P[10][2]*t2*t19-
P[10][3]*t2*t22+
P[10][5]*t2*
t27);
251 Kfusion[11][0] = t78*(
P[11][0]*t2*t5-
P[11][4]*t2*t7+
P[11][1]*t2*t15+
P[11][6]*t2*t10+
P[11][2]*t2*t19-
P[11][3]*t2*t22+
P[11][5]*t2*
t27);
252 Kfusion[12][0] = t78*(
P[12][0]*t2*t5-
P[12][4]*t2*t7+
P[12][1]*t2*t15+
P[12][6]*t2*t10+
P[12][2]*t2*t19-
P[12][3]*t2*t22+
P[12][5]*t2*
t27);
253 Kfusion[13][0] = t78*(
P[13][0]*t2*t5-
P[13][4]*t2*t7+
P[13][1]*t2*t15+
P[13][6]*t2*t10+
P[13][2]*t2*t19-
P[13][3]*t2*t22+
P[13][5]*t2*
t27);
254 Kfusion[14][0] = t78*(
P[14][0]*t2*t5-
P[14][4]*t2*t7+
P[14][1]*t2*t15+
P[14][6]*t2*t10+
P[14][2]*t2*t19-
P[14][3]*t2*t22+
P[14][5]*t2*
t27);
255 Kfusion[15][0] = t78*(
P[15][0]*t2*t5-
P[15][4]*t2*t7+
P[15][1]*t2*t15+
P[15][6]*t2*t10+
P[15][2]*t2*t19-
P[15][3]*t2*t22+
P[15][5]*t2*
t27);
256 Kfusion[16][0] = t78*(
P[16][0]*t2*t5-
P[16][4]*t2*t7+
P[16][1]*t2*t15+
P[16][6]*t2*t10+
P[16][2]*t2*t19-
P[16][3]*t2*t22+
P[16][5]*t2*
t27);
257 Kfusion[17][0] = t78*(
P[17][0]*t2*t5-
P[17][4]*t2*t7+
P[17][1]*t2*t15+
P[17][6]*t2*t10+
P[17][2]*t2*t19-
P[17][3]*t2*t22+
P[17][5]*t2*
t27);
258 Kfusion[18][0] = t78*(
P[18][0]*t2*t5-
P[18][4]*t2*t7+
P[18][1]*t2*t15+
P[18][6]*t2*t10+
P[18][2]*t2*t19-
P[18][3]*t2*t22+
P[18][5]*t2*
t27);
259 Kfusion[19][0] = t78*(
P[19][0]*t2*t5-
P[19][4]*t2*t7+
P[19][1]*t2*t15+
P[19][6]*t2*t10+
P[19][2]*t2*t19-
P[19][3]*t2*t22+
P[19][5]*t2*
t27);
260 Kfusion[20][0] = t78*(
P[20][0]*t2*t5-
P[20][4]*t2*t7+
P[20][1]*t2*t15+
P[20][6]*t2*t10+
P[20][2]*t2*t19-
P[20][3]*t2*t22+
P[20][5]*t2*
t27);
261 Kfusion[21][0] = t78*(
P[21][0]*t2*t5-
P[21][4]*t2*t7+
P[21][1]*t2*t15+
P[21][6]*t2*t10+
P[21][2]*t2*t19-
P[21][3]*t2*t22+
P[21][5]*t2*
t27);
262 Kfusion[22][0] = t78*(
P[22][0]*t2*t5-
P[22][4]*t2*t7+
P[22][1]*t2*t15+
P[22][6]*t2*t10+
P[22][2]*t2*t19-
P[22][3]*t2*t22+
P[22][5]*t2*
t27);
263 Kfusion[23][0] = t78*(
P[23][0]*t2*t5-
P[23][4]*t2*t7+
P[23][1]*t2*t15+
P[23][6]*t2*t10+
P[23][2]*t2*t19-
P[23][3]*t2*t22+
P[23][5]*t2*
t27);
268 }
else if (obs_index == 1) {
271 float t2 = 1.0f / range;
272 H_LOS[1][0] = -t2*(q2*vd*-2.0f+q3*ve*2.0f+q0*vn*2.0f);
273 H_LOS[1][1] = -t2*(q3*vd*2.0f+q2*ve*2.0f+q1*vn*2.0f);
274 H_LOS[1][2] = t2*(q0*vd*2.0f-q1*ve*2.0f+q2*vn*2.0f);
275 H_LOS[1][3] = -t2*(q1*vd*2.0f+q0*ve*2.0f-q3*vn*2.0f);
276 H_LOS[1][4] = -t2*(q0*q0+q1*q1-q2*q2-q3*q3);
277 H_LOS[1][5] = -t2*(q0*q3*2.0f+q1*q2*2.0f);
278 H_LOS[1][6] = t2*(q0*q2*2.0f-q1*q3*2.0f);
281 float t3 = q3*ve*2.0f;
282 float t4 = q0*vn*2.0f;
283 float t11 = q2*vd*2.0f;
284 float t5 = t3+t4-
t11;
285 float t6 = q0*q3*2.0f;
286 float t7 = q1*q2*2.0f;
288 float t9 = q0*q2*2.0f;
289 float t28 = q1*q3*2.0f;
291 float t12 =
P[0][0]*t2*
t5;
292 float t13 = q3*vd*2.0f;
293 float t14 = q2*ve*2.0f;
294 float t15 = q1*vn*2.0f;
296 float t17 = q0*vd*2.0f;
297 float t18 = q2*vn*2.0f;
298 float t29 = q1*ve*2.0f;
300 float t20 = q1*vd*2.0f;
301 float t21 = q0*ve*2.0f;
302 float t30 = q3*vn*2.0f;
308 float t27 = t23+t24-t25-
t26;
310 float t32 =
P[5][0]*t2*
t8;
316 float t36 = t12+t32+t33+t34+t35-t80-
t81;
318 float t38 =
P[5][1]*t2*
t8;
319 float t39 =
P[0][1]*t2*
t5;
324 float t42 = t31+t38+t39+t40+t41-t82-
t83;
326 float t44 =
P[5][2]*t2*
t8;
327 float t45 =
P[0][2]*t2*
t5;
333 float t49 = t44+t45+t46+t47+t48-t79-
t84;
334 float t50 =
P[5][3]*t2*
t8;
335 float t51 =
P[0][3]*t2*
t5;
341 float t55 = t50+t51+t52+t53+t54-t86-
t87;
343 float t57 =
P[5][4]*t2*
t8;
344 float t58 =
P[0][4]*t2*
t5;
350 float t62 = t57+t58+t59+t60+t61-t88-
t89;
352 float t64 =
P[5][5]*t2*
t8;
353 float t65 =
P[0][5]*t2*
t5;
359 float t69 = t64+t65+t66+t67+t68-t90-
t91;
361 float t71 =
P[5][6]*t2*
t8;
362 float t72 =
P[0][6]*t2*
t5;
368 float t76 = t71+t72+t73+t74+t75-t92-
t93;
371 float t77 = R_LOS+t37+t43+t56+t63+t70-t85-
t94;
385 Kfusion[0][1] = -t78*(t12+
P[0][5]*t2*t8-
P[0][6]*t2*t10+
P[0][1]*t2*t16-
P[0][2]*t2*t19+
P[0][3]*t2*t22+
P[0][4]*t2*
t27);
386 Kfusion[1][1] = -t78*(t31+
P[1][0]*t2*t5+
P[1][5]*t2*t8-
P[1][6]*t2*t10-
P[1][2]*t2*t19+
P[1][3]*t2*t22+
P[1][4]*t2*
t27);
387 Kfusion[2][1] = -t78*(-t79+
P[2][0]*t2*t5+
P[2][5]*t2*t8-
P[2][6]*t2*t10+
P[2][1]*t2*t16+
P[2][3]*t2*t22+
P[2][4]*t2*
t27);
388 Kfusion[3][1] = -t78*(t53+
P[3][0]*t2*t5+
P[3][5]*t2*t8-
P[3][6]*t2*t10+
P[3][1]*t2*t16-
P[3][2]*t2*t19+
P[3][4]*t2*
t27);
389 Kfusion[4][1] = -t78*(t61+
P[4][0]*t2*t5+
P[4][5]*t2*t8-
P[4][6]*t2*t10+
P[4][1]*t2*t16-
P[4][2]*t2*t19+
P[4][3]*t2*
t22);
390 Kfusion[5][1] = -t78*(t64+
P[5][0]*t2*t5-
P[5][6]*t2*t10+
P[5][1]*t2*t16-
P[5][2]*t2*t19+
P[5][3]*t2*t22+
P[5][4]*t2*
t27);
391 Kfusion[6][1] = -t78*(-t92+
P[6][0]*t2*t5+
P[6][5]*t2*t8+
P[6][1]*t2*t16-
P[6][2]*t2*t19+
P[6][3]*t2*t22+
P[6][4]*t2*
t27);
392 Kfusion[7][1] = -t78*(
P[7][0]*t2*t5+
P[7][5]*t2*t8-
P[7][6]*t2*t10+
P[7][1]*t2*t16-
P[7][2]*t2*t19+
P[7][3]*t2*t22+
P[7][4]*t2*
t27);
393 Kfusion[8][1] = -t78*(
P[8][0]*t2*t5+
P[8][5]*t2*t8-
P[8][6]*t2*t10+
P[8][1]*t2*t16-
P[8][2]*t2*t19+
P[8][3]*t2*t22+
P[8][4]*t2*
t27);
394 Kfusion[9][1] = -t78*(
P[9][0]*t2*t5+
P[9][5]*t2*t8-
P[9][6]*t2*t10+
P[9][1]*t2*t16-
P[9][2]*t2*t19+
P[9][3]*t2*t22+
P[9][4]*t2*
t27);
395 Kfusion[10][1] = -t78*(
P[10][0]*t2*t5+
P[10][5]*t2*t8-
P[10][6]*t2*t10+
P[10][1]*t2*t16-
P[10][2]*t2*t19+
P[10][3]*t2*t22+
P[10][4]*t2*
t27);
396 Kfusion[11][1] = -t78*(
P[11][0]*t2*t5+
P[11][5]*t2*t8-
P[11][6]*t2*t10+
P[11][1]*t2*t16-
P[11][2]*t2*t19+
P[11][3]*t2*t22+
P[11][4]*t2*
t27);
397 Kfusion[12][1] = -t78*(
P[12][0]*t2*t5+
P[12][5]*t2*t8-
P[12][6]*t2*t10+
P[12][1]*t2*t16-
P[12][2]*t2*t19+
P[12][3]*t2*t22+
P[12][4]*t2*
t27);
398 Kfusion[13][1] = -t78*(
P[13][0]*t2*t5+
P[13][5]*t2*t8-
P[13][6]*t2*t10+
P[13][1]*t2*t16-
P[13][2]*t2*t19+
P[13][3]*t2*t22+
P[13][4]*t2*
t27);
399 Kfusion[14][1] = -t78*(
P[14][0]*t2*t5+
P[14][5]*t2*t8-
P[14][6]*t2*t10+
P[14][1]*t2*t16-
P[14][2]*t2*t19+
P[14][3]*t2*t22+
P[14][4]*t2*
t27);
400 Kfusion[15][1] = -t78*(
P[15][0]*t2*t5+
P[15][5]*t2*t8-
P[15][6]*t2*t10+
P[15][1]*t2*t16-
P[15][2]*t2*t19+
P[15][3]*t2*t22+
P[15][4]*t2*
t27);
401 Kfusion[16][1] = -t78*(
P[16][0]*t2*t5+
P[16][5]*t2*t8-
P[16][6]*t2*t10+
P[16][1]*t2*t16-
P[16][2]*t2*t19+
P[16][3]*t2*t22+
P[16][4]*t2*
t27);
402 Kfusion[17][1] = -t78*(
P[17][0]*t2*t5+
P[17][5]*t2*t8-
P[17][6]*t2*t10+
P[17][1]*t2*t16-
P[17][2]*t2*t19+
P[17][3]*t2*t22+
P[17][4]*t2*
t27);
403 Kfusion[18][1] = -t78*(
P[18][0]*t2*t5+
P[18][5]*t2*t8-
P[18][6]*t2*t10+
P[18][1]*t2*t16-
P[18][2]*t2*t19+
P[18][3]*t2*t22+
P[18][4]*t2*
t27);
404 Kfusion[19][1] = -t78*(
P[19][0]*t2*t5+
P[19][5]*t2*t8-
P[19][6]*t2*t10+
P[19][1]*t2*t16-
P[19][2]*t2*t19+
P[19][3]*t2*t22+
P[19][4]*t2*
t27);
405 Kfusion[20][1] = -t78*(
P[20][0]*t2*t5+
P[20][5]*t2*t8-
P[20][6]*t2*t10+
P[20][1]*t2*t16-
P[20][2]*t2*t19+
P[20][3]*t2*t22+
P[20][4]*t2*
t27);
406 Kfusion[21][1] = -t78*(
P[21][0]*t2*t5+
P[21][5]*t2*t8-
P[21][6]*t2*t10+
P[21][1]*t2*t16-
P[21][2]*t2*t19+
P[21][3]*t2*t22+
P[21][4]*t2*
t27);
407 Kfusion[22][1] = -t78*(
P[22][0]*t2*t5+
P[22][5]*t2*t8-
P[22][6]*t2*t10+
P[22][1]*t2*t16-
P[22][2]*t2*t19+
P[22][3]*t2*t22+
P[22][4]*t2*
t27);
408 Kfusion[23][1] = -t78*(
P[23][0]*t2*t5+
P[23][5]*t2*t8-
P[23][6]*t2*t10+
P[23][1]*t2*t16-
P[23][2]*t2*t19+
P[23][3]*t2*t22+
P[23][4]*t2*
t27);
417 bool flow_fail =
false;
419 for (uint8_t obs_index = 0; obs_index <= 1; obs_index++) {
420 if (optflow_test_ratio[obs_index] > 1.0
f) {
436 for (uint8_t obs_index = 0; obs_index <= 1; obs_index++) {
441 for (
unsigned row = 0; row <= 23; row++) {
442 gain[row] = Kfusion[row][obs_index];
453 KH[0] = gain[row] * H_LOS[obs_index][0];
454 KH[1] = gain[row] * H_LOS[obs_index][1];
455 KH[2] = gain[row] * H_LOS[obs_index][2];
456 KH[3] = gain[row] * H_LOS[obs_index][3];
457 KH[4] = gain[row] * H_LOS[obs_index][4];
458 KH[5] = gain[row] * H_LOS[obs_index][5];
459 KH[6] = gain[row] * H_LOS[obs_index][6];
461 for (
unsigned column = 0; column <
_k_num_states; column++) {
462 float tmp = KH[0] *
P[0][column];
463 tmp += KH[1] * P[1][column];
464 tmp += KH[2] * P[2][column];
465 tmp += KH[3] * P[3][column];
466 tmp += KH[4] * P[4][column];
467 tmp += KH[5] * P[5][column];
468 tmp += KH[6] * P[6][column];
469 KHP[row][column] = tmp;
480 if (
P[i][i] < KHP[i][i]) {
489 if (obs_index == 0) {
492 }
else if (obs_index == 1) {
502 for (
unsigned column = 0; column <
_k_num_states; column++) {
503 P[row][column] =
P[row][column] - KHP[row][column];
553 if (use_flow_sensor_gyro) {
598 if (weighting >= 1.0
f) {
607 float R_LOS =
sq(R_LOS_best * weighting + R_LOS_worst * (1.0
f - weighting));
Matrix3f quat_to_invrotmat(const Quatf &quat)
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
Adapter / shim layer for system calls needed by ECL.
stateSample _state
state struct of the ekf running at the delayed time horizon
float _flow_innov[2]
flow measurement innovation (rad/sec)
bool bad_optflow_X
7 - true if fusion of the optical flow X axis has encountered a numerical error
float flow_noise
observation noise for optical flow LOS rate measurements (rad/sec)
Vector3f _imu_del_ang_of
bias corrected delta angle measurements accumulated across the same time frame as the optical flow ra...
float _drag_innov[2]
multirotor drag measurement innovation (m/sec**2)
void get_drag_innov_var(float drag_innov_var[2]) override
Vector3f _flow_gyro_bias
bias errors in optical flow sensor rate gyro outputs (rad/sec)
void initialiseCovariance()
Vector3f cross_product(const Vector3f &vecIn1, const Vector3f &vecIn2)
struct estimator::fault_status_u::@57 flags
Vector3f gyroXYZ
measured delta angle of the inertial frame about the body axes obtained from rate gyro measurements (...
float _flow_max_rate
maximum angular flow rate that the optical flow sensor can measure (rad/s)
void get_flow_innov_var(float flow_innov_var[2]) override
float dt
amount of integration time (sec)
float P[_k_num_states][_k_num_states]
state covariance matrix
void zeroCols(float(&cov_mat)[_k_num_states][_k_num_states], uint8_t first, uint8_t last)
float _terrain_vpos
estimated vertical position of the terrain underneath the vehicle in local NED frame (m) ...
uint64_t _time_last_of_fuse
time the last fusion of optical flow measurements were performed (uSec)
void fuse(float *K, float innovation)
Dcmf _R_to_earth
transformation matrix from body frame to earth frame from last EKF prediction
float flow_innov_gate
optical flow fusion innovation consistency gate size (STD)
Vector2f _flowRadXYcomp
measured delta angle of the image about the X and Y body axes after removal of body rotation (rad)...
Vector3f flow_pos_body
xyz position of range sensor focal point in body frame (m)
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
Vector2< float > Vector2f
float _drag_innov_var[2]
multirotor drag measurement innovation variance ((m/sec**2)**2)
float rng_gnd_clearance
minimum valid value for range when on ground (m)
uint8_t quality
quality indicator between 0 and 255
Vector3f vel
NED velocity in earth frame in m/s.
static constexpr float sq(float var)
fault_status_u _fault_status
float _delta_time_of
time in sec that _imu_del_ang_of was accumulated over (sec)
void fixCovarianceErrors()
float flow_noise_qual_min
observation noise for optical flow LOS rate measurements when flow sensor quality is at the minimum u...
void get_flow_innov(float flow_innov[2]) override
Quatf quat_nominal
quaternion defining the rotation from body to earth frame
Vector3f pos
NED position in earth frame in m.
innovation_fault_status_u _innov_check_fail_status
Vector3< float > Vector3f
constexpr _Tp max(_Tp a, _Tp b)
float _flow_innov_var[2]
flow innovation variance ((rad/sec)**2)
void zeroRows(float(&cov_mat)[_k_num_states][_k_num_states], uint8_t first, uint8_t last)
flowSample _flow_sample_delayed
Vector3f imu_pos_body
xyz position of IMU in body frame (m)
bool bad_optflow_Y
8 - true if fusion of the optical flow Y axis has encountered a numerical error
int32_t flow_qual_min
minimum acceptable quality integer from the flow sensor
static constexpr uint8_t _k_num_states
number of EKF states
bool calcOptFlowBodyRateComp()
void get_drag_innov(float drag_innov[2]) override
Class for core functions for ekf attitude and position estimator.
float calcOptFlowMeasVar()