Browse Source

TECS: Fix internal state init if dt is large

release/1.12
CarlOlsson 4 years ago committed by Lorenz Meier
parent
commit
0f461f7f60
  1. 2
      src/lib/tecs/TECS.cpp

2
src/lib/tecs/TECS.cpp

@ -536,7 +536,7 @@ void TECS::update_pitch_throttle(float pitch, float baro_altitude, float hgt_set @@ -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;

Loading…
Cancel
Save