mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 01:41:37 +08:00
mc_att_control: reduce minimum required dt
2ms is not enough to run at 1kHz
This commit is contained in:
@@ -703,9 +703,9 @@ MulticopterAttitudeControl::run()
|
|||||||
float dt = (now - last_run) / 1e6f;
|
float dt = (now - last_run) / 1e6f;
|
||||||
last_run = now;
|
last_run = now;
|
||||||
|
|
||||||
/* guard against too small (< 2ms) and too large (> 20ms) dt's */
|
/* guard against too small (< 0.2ms) and too large (> 20ms) dt's */
|
||||||
if (dt < 0.002f) {
|
if (dt < 0.0002f) {
|
||||||
dt = 0.002f;
|
dt = 0.0002f;
|
||||||
|
|
||||||
} else if (dt > 0.02f) {
|
} else if (dt > 0.02f) {
|
||||||
dt = 0.02f;
|
dt = 0.02f;
|
||||||
|
|||||||
Reference in New Issue
Block a user