Skip to content

Commit bdb4251

Browse files
authored
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
1 parent e3d31a8 commit bdb4251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ FixedwingPositionControl::tecs_update_pitch_throttle(float alt_sp, float airspee
17561756
if (_param_fw_thr_alt_scl.get() > FLT_EPSILON) {
17571757
vehicle_air_data_s air_data;
17581758

1759-
if (_vehicle_air_data_sub.update(&air_data)) {
1759+
if (_vehicle_air_data_sub.copy(&air_data)) {
17601760
if (PX4_ISFINITE(air_data.baro_pressure_pa) && PX4_ISFINITE(_param_fw_thr_alt_scl.get())) {
17611761
// scale throttle as a function of sqrt(p0/p) (~ EAS -> TAS at low speeds and altitudes ignoring temperature)
17621762
const float eas2tas = sqrtf(CONSTANTS_STD_PRESSURE_PA / air_data.baro_pressure_pa);

0 commit comments

Comments
 (0)