mc_att_control: reduce minimum required dt

2ms is not enough to run at 1kHz
This commit is contained in:
Beat Küng 2018-10-25 07:46:27 +02:00 committed by Daniel Agar
parent d552c2a362
commit fc997dd0d5

View File

@ -703,9 +703,9 @@ MulticopterAttitudeControl::run()
float dt = (now - last_run) / 1e6f;
last_run = now;
/* guard against too small (< 2ms) and too large (> 20ms) dt's */
if (dt < 0.002f) {
dt = 0.002f;
/* guard against too small (< 0.2ms) and too large (> 20ms) dt's */
if (dt < 0.0002f) {
dt = 0.0002f;
} else if (dt > 0.02f) {
dt = 0.02f;