TECS: Fix internal state init if dt is large

This commit is contained in:
CarlOlsson
2021-02-24 11:14:08 +01:00
committed by Lorenz Meier
parent 114e85d260
commit 0f461f7f60

View File

@@ -536,7 +536,7 @@ void TECS::update_pitch_throttle(float pitch, float baro_altitude, float hgt_set
{
// Calculate the time since last update (seconds)
uint64_t now = hrt_absolute_time();
_dt = constrain((now - _pitch_update_timestamp) * 1e-6f, DT_MIN, DT_MAX);
_dt = fmaxf((now - _pitch_update_timestamp) * 1e-6f, DT_MIN);
// Set class variables from inputs
_throttle_setpoint_max = throttle_max;