From 2f9ff3ef73828d3f5726c73e237d9eb58aff8340 Mon Sep 17 00:00:00 2001 From: George Zogopoulos Date: Tue, 19 Nov 2024 12:41:38 +0100 Subject: [PATCH] Plane: Call new TECS method in case of altitude change --- ArduPlane/altitude.cpp | 2 +- libraries/AP_TECS/AP_TECS.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ArduPlane/altitude.cpp b/ArduPlane/altitude.cpp index c32f5802a8..230a16d067 100644 --- a/ArduPlane/altitude.cpp +++ b/ArduPlane/altitude.cpp @@ -44,7 +44,7 @@ void Plane::check_home_alt_change(void) next_WP_loc.alt += alt_change_cm; } // reset TECS to force the field elevation estimate to reset - TECS_controller.reset(); + TECS_controller.offset_altitude(alt_change_cm * 0.01f); } auto_state.last_home_alt_cm = home_alt_cm; } diff --git a/libraries/AP_TECS/AP_TECS.cpp b/libraries/AP_TECS/AP_TECS.cpp index 34df07b2bc..69575aab7a 100644 --- a/libraries/AP_TECS/AP_TECS.cpp +++ b/libraries/AP_TECS/AP_TECS.cpp @@ -1527,4 +1527,5 @@ void AP_TECS::offset_altitude(const float alt_offset) // _hgt_dem // _hgt_dem_in_raw // _hgt_dem_in + // Energies } \ No newline at end of file