From 0c4b2cd0c5aa29e5efe7b4499500adf70c97cbca Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 7 Oct 2022 11:36:10 +0200 Subject: [PATCH] airspeed_selector: update wind estimator (w/o airspeed fusion) always if in FW mode This fixes a bug where by accident the vtol_status was considered instead of the vehicle_status, preventing it from running on planes. Signed-off-by: Silvan Fuhrer --- src/modules/airspeed_selector/airspeed_selector_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/airspeed_selector/airspeed_selector_main.cpp b/src/modules/airspeed_selector/airspeed_selector_main.cpp index 5a8ea59f17..7956ac0b0b 100644 --- a/src/modules/airspeed_selector/airspeed_selector_main.cpp +++ b/src/modules/airspeed_selector/airspeed_selector_main.cpp @@ -521,8 +521,8 @@ void AirspeedModule::update_wind_estimator_sideslip() _wind_estimator_sideslip.update(_time_now_usec); if (_vehicle_local_position_valid - && _vtol_vehicle_status.vehicle_vtol_state == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW && - _vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED) { + && _vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING + && _vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED) { Vector3f vI(_vehicle_local_position.vx, _vehicle_local_position.vy, _vehicle_local_position.vz); Quatf q(_vehicle_attitude.q);