mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 12:13:33 +08:00
Q attitude estimator: Prevent division by zero
This commit is contained in:
@@ -398,7 +398,7 @@ void AttitudeEstimatorQ::task_main()
|
|||||||
|
|
||||||
// Time from previous iteration
|
// Time from previous iteration
|
||||||
hrt_abstime now = hrt_absolute_time();
|
hrt_abstime now = hrt_absolute_time();
|
||||||
float dt = (last_time > 0) ? ((now - last_time) / 1000000.0f) : 0.0f;
|
float dt = (last_time > 0) ? ((now - last_time) / 1000000.0f) : 0.00001f;
|
||||||
last_time = now;
|
last_time = now;
|
||||||
|
|
||||||
if (dt > _dt_max) {
|
if (dt > _dt_max) {
|
||||||
|
|||||||
Reference in New Issue
Block a user