From 05672f343dab78a381d67631fb006ec352ef2c12 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Tue, 9 Apr 2024 10:25:46 +0200 Subject: [PATCH] TECS: check if integrator update is finit prior applying Signed-off-by: Silvan Fuhrer --- src/lib/tecs/TECS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tecs/TECS.cpp b/src/lib/tecs/TECS.cpp index b0d9c43b20..b3148c4a7c 100644 --- a/src/lib/tecs/TECS.cpp +++ b/src/lib/tecs/TECS.cpp @@ -576,7 +576,7 @@ void TECSControl::_calcThrottleControlUpdate(float dt, const STERateLimit &limit // Calculate a throttle demand from the integrated total energy rate error // This will be added to the total throttle demand to compensate for steady state errors - _throttle_integ_state = _throttle_integ_state + throttle_integ_input; + _throttle_integ_state = PX4_ISFINITE(throttle_integ_input) ? _throttle_integ_state + throttle_integ_input : 0.f; } else { _throttle_integ_state = 0.0f;