From bdb4251fa4a8f758b00c03f76f48cc621772bf1b Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 17 Jul 2020 17:14:45 -0400 Subject: [PATCH] fw_pos_control_l1: if using air data (baro) copy every cycle - vehicle_air_data won't necessary have an update every iteration and these adjusted throttle values aren't stored - this only would have worked in the past because the vast majority of systems were using the ms5611 barometer with a publication rate that's faster than the controller --- src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 3584e59301..434c06f795 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -1756,7 +1756,7 @@ FixedwingPositionControl::tecs_update_pitch_throttle(float alt_sp, float airspee if (_param_fw_thr_alt_scl.get() > FLT_EPSILON) { vehicle_air_data_s air_data; - if (_vehicle_air_data_sub.update(&air_data)) { + if (_vehicle_air_data_sub.copy(&air_data)) { if (PX4_ISFINITE(air_data.baro_pressure_pa) && PX4_ISFINITE(_param_fw_thr_alt_scl.get())) { // scale throttle as a function of sqrt(p0/p) (~ EAS -> TAS at low speeds and altitudes ignoring temperature) const float eas2tas = sqrtf(CONSTANTS_STD_PRESSURE_PA / air_data.baro_pressure_pa);