mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 18:10:34 +08:00
multicopter: minimize dt jitter by using estimate timestamp_sample
This commit is contained in:
@@ -291,7 +291,7 @@ void MulticopterPositionControl::Run()
|
||||
vehicle_local_position_s local_pos;
|
||||
|
||||
if (_local_pos_sub.update(&local_pos)) {
|
||||
const hrt_abstime time_stamp_now = local_pos.timestamp;
|
||||
const hrt_abstime time_stamp_now = local_pos.timestamp_sample;
|
||||
const float dt = math::constrain(((time_stamp_now - _time_stamp_last_loop) * 1e-6f), 0.002f, 0.04f);
|
||||
_time_stamp_last_loop = time_stamp_now;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user