3 #if HAL_CPU_CLASS >= HAL_CPU_CLASS_150 69 rngPred = deltaPosNED.
length();
86 float t9 = 1.0f/sqrtf(t8);
102 float t20 =
P[8][6]*t2*
t9;
103 float t21 =
P[7][6]*t3*
t9;
104 float t22 =
P[6][6]*t4*
t9;
120 Kfusion[0] = -t26*(
P[0][6]*t4*t9+
P[0][7]*t3*t9+
P[0][8]*t2*
t9);
121 Kfusion[1] = -t26*(
P[1][6]*t4*t9+
P[1][7]*t3*t9+
P[1][8]*t2*
t9);
122 Kfusion[2] = -t26*(
P[2][6]*t4*t9+
P[2][7]*t3*t9+
P[2][8]*t2*
t9);
123 Kfusion[3] = -t26*(
P[3][6]*t4*t9+
P[3][7]*t3*t9+
P[3][8]*t2*
t9);
124 Kfusion[4] = -t26*(
P[4][6]*t4*t9+
P[4][7]*t3*t9+
P[4][8]*t2*
t9);
125 Kfusion[6] = -t26*(t22+
P[6][7]*t3*t9+
P[6][8]*t2*
t9);
126 Kfusion[7] = -t26*(t16+
P[7][6]*t4*t9+
P[7][8]*t2*
t9);
129 Kfusion[5] = -t26*(
P[5][6]*t4*t9+
P[5][7]*t3*t9+
P[5][8]*t2*
t9);
130 Kfusion[8] = -t26*(t10+
P[8][6]*t4*t9+
P[8][7]*t3*
t9);
131 Kfusion[15] = -t26*(
P[15][6]*t4*t9+
P[15][7]*t3*t9+
P[15][8]*t2*
t9);
141 Kfusion[9] = -t26*(
P[9][6]*t4*t9+
P[9][7]*t3*t9+
P[9][8]*t2*
t9);
142 Kfusion[10] = -t26*(
P[10][6]*t4*t9+
P[10][7]*t3*t9+
P[10][8]*t2*
t9);
143 Kfusion[11] = -t26*(
P[11][6]*t4*t9+
P[11][7]*t3*t9+
P[11][8]*t2*
t9);
144 Kfusion[12] = -t26*(
P[12][6]*t4*t9+
P[12][7]*t3*t9+
P[12][8]*t2*
t9);
145 Kfusion[13] = -t26*(
P[13][6]*t4*t9+
P[13][7]*t3*t9+
P[13][8]*t2*
t9);
146 Kfusion[14] = -t26*(
P[14][6]*t4*t9+
P[14][7]*t3*t9+
P[14][8]*t2*
t9);
148 Kfusion[16] = -t26*(
P[16][6]*t4*t9+
P[16][7]*t3*t9+
P[16][8]*t2*
t9);
149 Kfusion[17] = -t26*(
P[17][6]*t4*t9+
P[17][7]*t3*t9+
P[17][8]*t2*
t9);
150 Kfusion[18] = -t26*(
P[18][6]*t4*t9+
P[18][7]*t3*t9+
P[18][8]*t2*
t9);
151 Kfusion[19] = -t26*(
P[19][6]*t4*t9+
P[19][7]*t3*t9+
P[19][8]*t2*
t9);
152 Kfusion[20] = -t26*(
P[20][6]*t4*t9+
P[20][7]*t3*t9+
P[20][8]*t2*
t9);
153 Kfusion[21] = -t26*(
P[21][6]*t4*t9+
P[21][7]*t3*t9+
P[21][8]*t2*
t9);
156 memset(&Kfusion[16], 0, 24);
158 Kfusion[22] = -t26*(
P[22][6]*t4*t9+
P[22][7]*t3*t9+
P[22][8]*t2*
t9);
159 Kfusion[23] = -t26*(
P[23][6]*t4*t9+
P[23][7]*t3*t9+
P[23][8]*t2*
t9);
181 for (
unsigned j = 0; j<=5; j++) {
184 for (
unsigned j = 6; j<=8; j++) {
185 KH[i][j] = Kfusion[i] * H_BCN[j];
187 for (
unsigned j = 9; j<=23; j++) {
194 res +=
KH[i][6] *
P[6][j];
195 res +=
KH[i][7] * P[7][j];
196 res +=
KH[i][8] * P[8][j];
201 bool healthyFusion =
true;
203 if (
KHP[i][i] >
P[i][i]) {
204 healthyFusion =
false;
211 P[i][j] =
P[i][j] -
KHP[i][j];
337 float receverPosDownMax;
338 float receverPosDownMin;
356 for (uint8_t i= 0; i<=2; i++) {
372 float t9 = 1.0f/sqrtf(t8);
383 H_RNG[0] = -t9*t11*0.5f;
384 H_RNG[1] = -t9*t13*0.5f;
385 H_RNG[2] = -t9*t17*0.5f;
393 float t24 = t9*t13*t23*0.5f;
398 float t29 = t9*t17*t28*0.5f;
402 float t33 = t9*t11*t32*0.5f;
422 for (
unsigned i = 0; i<=2; i++) {
423 for (
unsigned j = 0; j<=2; j++) {
424 KH[i][j] = K_RNG[i] * H_RNG[j];
427 for (
unsigned j = 0; j<=2; j++) {
428 for (
unsigned i = 0; i<=2; i++) {
431 res +=
KH[i][1] * receiverPosCov[1][j];
432 res +=
KH[i][2] * receiverPosCov[2][j];
437 for (uint8_t i= 0; i<=2; i++) {
446 for (uint8_t i= 0; i<=2; i++) {
447 for (uint8_t j= 0; j<=2; j++) {
452 for (uint8_t i=1; i<=2; i++) {
453 for (uint8_t j=0; j<=i-1; j++) {
485 const float stateNoiseVar = 0.1f;
486 const float filtAlpha = 0.01f;
487 const float innovGateWidth = 5.0f;
515 innovVar =
MAX(innovVar, obsVar);
518 if ((
sq(innov) <
sq(innovGateWidth) * innovVar) || aligning) {
527 bcnPosOffsetMaxVar =
MAX(bcnPosOffsetMaxVar, 0.0
f);
552 innovVar =
MAX(innovVar, obsVar);
555 if ((
sq(innov) <
sq(innovGateWidth) * innovVar) || aligning) {
564 bcnPosOffsetMinVar =
MAX(bcnPosOffsetMinVar, 0.0
f);
584 #endif // HAL_CPU_CLASS
void CalcRangeBeaconPosDownOffset(float obsVar, Vector3f &vehiclePosNED, bool aligning)
Interface definition for the various Ground Control System.
bool rngBcnAlignmentStarted
struct NavEKF2_core::state_elements & stateStruct
uint32_t imuSampleTime_ms
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
float receiverPosCov[3][3]
struct NavEKF2_core::@145 faultStatus
void SelectRngBcnFusion()
void ConstrainVariances()
uint32_t lastRngBcnPassTime_ms
rng_bcn_elements rngBcnDataDelayed
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
bool rngBcnAlignmentCompleted
void rotate(const Vector3f &v)
AP_Int16 _rngBcnInnovGate
struct NavEKF2_core::@144 rngBcnFusionReport[10]