ekf2: add kconfig option to enable/disable range finder fusion (and terrain estimator)

This commit is contained in:
Daniel Agar
2023-03-21 11:25:34 -04:00
parent 0784901a66
commit 32a5bd32ad
17 changed files with 343 additions and 173 deletions
+4
View File
@@ -238,9 +238,13 @@ bool Ekf::haglYawResetReq()
if (_control_status.flags.in_air && _control_status.flags.yaw_align && !_control_status.flags.mag_aligned_in_flight) {
// Check if height has increased sufficiently to be away from ground magnetic anomalies
// and request a yaw reset if not already requested.
#if defined(CONFIG_EKF2_RANGE_FINDER)
static constexpr float mag_anomalies_max_hagl = 1.5f;
const bool above_mag_anomalies = (getTerrainVPos() - _state.pos(2)) > mag_anomalies_max_hagl;
return above_mag_anomalies;
#else
return true;
#endif // CONFIG_EKF2_RANGE_FINDER
}
return false;