mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-28 11:00:38 +08:00
Q attitude estimator: Prevent division by zero
This commit is contained in:
1 parent
b61e95adfd
commit
c4f9318e75
1 file changed
+1
-1
@@ -398,7 +398,7 @@ void AttitudeEstimatorQ::task_main()
|
||||
|
||||
// Time from previous iteration
|
||||
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;
|
||||
|
||||
if (dt > _dt_max) {
|
||||
|
||||
Reference in new issue
Block a user