EKF2: only check for EKF2_BETA_FUSION when corresponding kconfig option is set

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-03-21 20:54:46 +01:00
parent 98d07ad1f3
commit d532578ecc
1 changed files with 4 additions and 0 deletions

View File

@ -2361,11 +2361,15 @@ void EKF2::UpdateSystemFlagsSample(ekf2_timestamps_s &ekf2_timestamps)
// let the EKF know if the vehicle motion is that of a fixed wing (forward flight only relative to wind)
flags.is_fixed_wing = (vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING);
#if defined(CONFIG_EKF2_SIDESLIP)
if (vehicle_status.is_vtol_tailsitter && _params->beta_fusion_enabled) {
PX4_WARN("Disable EKF beta fusion as unsupported for tailsitter");
_param_ekf2_fuse_beta.set(0);
_param_ekf2_fuse_beta.commit_no_notification();
}
#endif // CONFIG_EKF2_SIDESLIP
}
// vehicle_land_detected