From e546584555b77478a5608d7e6fd8f6d8ba860cc6 Mon Sep 17 00:00:00 2001 From: RomanBapst Date: Fri, 11 Dec 2020 09:30:23 +0300 Subject: [PATCH] tecs: moved trivial getter methods to header file Signed-off-by: RomanBapst --- src/lib/tecs/TECS.cpp | 20 -------------------- src/lib/tecs/TECS.hpp | 9 +++++---- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/lib/tecs/TECS.cpp b/src/lib/tecs/TECS.cpp index 2fab00db54..7462dd84cc 100644 --- a/src/lib/tecs/TECS.cpp +++ b/src/lib/tecs/TECS.cpp @@ -627,23 +627,3 @@ void TECS::_update_speed_height_weights() _SPE_weighting = constrain(2.0f - _SKE_weighting, 0.f, 1.f); _SKE_weighting = constrain(_SKE_weighting, 0.f, 1.f); } - -float TECS::SEB() -{ - return _SPE_estimate * _SPE_weighting - _SKE_estimate * _SKE_weighting; -} - -float TECS::SEB_setpoint() -{ - return _SPE_setpoint * _SPE_weighting - _SKE_setpoint * _SKE_weighting; -} - -float TECS::SEB_rate() -{ - return _SPE_rate * _SPE_weighting - _SKE_rate * _SKE_weighting; -} - -float TECS::SEB_rate_setpoint() -{ - return _SPE_rate_setpoint * _SPE_weighting - _SKE_rate_setpoint * _SKE_weighting; -} diff --git a/src/lib/tecs/TECS.hpp b/src/lib/tecs/TECS.hpp index c12f74dd9d..67fd70c70f 100644 --- a/src/lib/tecs/TECS.hpp +++ b/src/lib/tecs/TECS.hpp @@ -164,13 +164,14 @@ public: float STE_rate_setpoint() { return _SPE_rate_setpoint + _SKE_rate_setpoint; } - float SEB(); + float SEB() { return _SPE_estimate * _SPE_weighting - _SKE_estimate * _SKE_weighting; } - float SEB_setpoint(); + float SEB_setpoint() { return _SPE_setpoint * _SPE_weighting - _SKE_setpoint * _SKE_weighting; } - float SEB_rate(); + float SEB_rate() { return _SPE_rate * _SPE_weighting - _SKE_rate * _SKE_weighting; } + + float SEB_rate_setpoint() { return _SPE_rate_setpoint * _SPE_weighting - _SKE_rate_setpoint * _SKE_weighting; } - float SEB_rate_setpoint(); /** * Handle the altitude reset