From 0c7538539571059d1a9d2ee2f2533baba496614f Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 8 May 2020 10:46:24 +0200 Subject: [PATCH] replace IAS with EAS in FW attitude controller (#14868) The EAS is the calibrated airspeed corrected with a scaling factor to account for sensor error/placement of pitot. Signed-off-by: Silvan Fuhrer --- src/modules/fw_att_control/FixedwingAttitudeControl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index 2b0f882720d1..137e6b12638f 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -235,7 +235,7 @@ FixedwingAttitudeControl::vehicle_land_detected_poll() float FixedwingAttitudeControl::get_airspeed_and_update_scaling() { _airspeed_validated_sub.update(); - const bool airspeed_valid = PX4_ISFINITE(_airspeed_validated_sub.get().indicated_airspeed_m_s) + const bool airspeed_valid = PX4_ISFINITE(_airspeed_validated_sub.get().equivalent_airspeed_m_s) && (hrt_elapsed_time(&_airspeed_validated_sub.get().timestamp) < 1_s); // if no airspeed measurement is available out best guess is to use the trim airspeed @@ -243,7 +243,7 @@ float FixedwingAttitudeControl::get_airspeed_and_update_scaling() if ((_param_fw_arsp_mode.get() == 0) && airspeed_valid) { /* prevent numerical drama by requiring 0.5 m/s minimal speed */ - airspeed = math::max(0.5f, _airspeed_validated_sub.get().indicated_airspeed_m_s); + airspeed = math::max(0.5f, _airspeed_validated_sub.get().equivalent_airspeed_m_s); } else { // VTOL: if we have no airspeed available and we are in hover mode then assume the lowest airspeed possible