mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
mc_att_control: use attitude timestamp for dt
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user