TECS: improve initialization

-remove external init, and instead always (but only) init when dt is too large
-init the controller params correctly

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2023-12-12 15:16:38 +01:00
committed by Matthias Grob
parent 1f5fc3e849
commit 60e2c6a5cb
4 changed files with 52 additions and 83 deletions
@@ -270,12 +270,6 @@ private:
bool _landed{true};
// indicates whether the plane was in the air in the previous interation
bool _was_in_air{false};
// [us] time at which the plane went in the air
hrt_abstime _time_went_in_air{0};
// MANUAL MODES
// indicates whether we have completed a manual takeoff in a position control mode
@@ -388,10 +382,7 @@ private:
// total energy control system - airspeed / altitude control
TECS _tecs;
bool _reinitialize_tecs{true};
bool _tecs_is_running{false};
hrt_abstime _time_last_tecs_update{0}; // [us]
// VTOL / TRANSITION
float _airspeed_after_transition{0.0f};