mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 22:13:34 +08:00
Bring declaration and initialization together
This commit is contained in:
committed by
Mathieu Bresciani
parent
796afd5f98
commit
e357376797
@@ -146,13 +146,10 @@ void Ekf::fuseGpsYaw()
|
||||
_heading_innov_var += H_YAW[row] * PH[row];
|
||||
}
|
||||
|
||||
float heading_innov_var_inv;
|
||||
|
||||
// check if the innovation variance calculation is badly conditioned
|
||||
if (_heading_innov_var >= R_YAW) {
|
||||
// the innovation variance contribution from the state covariances is not negative, no fault
|
||||
_fault_status.flags.bad_hdg = false;
|
||||
heading_innov_var_inv = 1.0f / _heading_innov_var;
|
||||
|
||||
} else {
|
||||
// the innovation variance contribution from the state covariances is negative which means the covariance matrix is badly conditioned
|
||||
@@ -164,6 +161,8 @@ void Ekf::fuseGpsYaw()
|
||||
return;
|
||||
}
|
||||
|
||||
const float heading_innov_var_inv = 1.f / _heading_innov_var;
|
||||
|
||||
// calculate the Kalman gains
|
||||
// only calculate gains for states we are using
|
||||
Vector24f Kfusion;
|
||||
|
||||
Reference in New Issue
Block a user