Move variable declaration to better place &

remove airspeed_innov_var_temp variable. setting to global variable even when fusion is aborted is okay
This commit is contained in:
kamilritz
2020-07-03 17:32:48 +02:00
committed by Mathieu Bresciani
parent 05855b7fc1
commit b5765eb3b4
4 changed files with 24 additions and 33 deletions
+2 -2
View File
@@ -1279,8 +1279,6 @@ void Ekf::controlFakePosFusion()
// Fuse synthetic position observations every 200msec
if (isTimedOut(_time_last_fake_pos, (uint64_t)2e5)) {
Vector3f fake_pos_obs_var;
// Reset position and velocity states if we re-commence this aiding method
if (isTimedOut(_time_last_fake_pos, (uint64_t)4e5)) {
resetHorizontalPosition();
@@ -1294,6 +1292,8 @@ void Ekf::controlFakePosFusion()
}
_time_last_fake_pos = _time_last_imu;
Vector3f fake_pos_obs_var;
if (_control_status.flags.in_air && _control_status.flags.tilt_align) {
fake_pos_obs_var(0) = fake_pos_obs_var(1) = sq(fmaxf(_params.pos_noaid_noise, _params.gps_pos_noise));