From d532578ecc470e186e64a48e6bf98666a2d2fb03 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Tue, 21 Mar 2023 20:54:46 +0100 Subject: [PATCH] EKF2: only check for EKF2_BETA_FUSION when corresponding kconfig option is set Signed-off-by: Silvan Fuhrer --- src/modules/ekf2/EKF2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/ekf2/EKF2.cpp b/src/modules/ekf2/EKF2.cpp index 129c4bfdcf..72e206a59a 100644 --- a/src/modules/ekf2/EKF2.cpp +++ b/src/modules/ekf2/EKF2.cpp @@ -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