diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 0af4095381..3e45815957 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -287,10 +287,10 @@ MulticopterAttitudeControl::Run() _attitude_control.adaptAttitudeSetpoint(delta_q_reset); } - const hrt_abstime now = hrt_absolute_time(); + const hrt_abstime now = _v_att.timestamp; // Guard against too small (< 0.2ms) and too large (> 20ms) dt's. - const float dt = math::constrain(((now - _last_run) / 1e6f), 0.0002f, 0.02f); + const float dt = math::constrain(((now - _last_run) * 1e-6f), 0.0002f, 0.02f); _last_run = now; /* check for updates in other topics */