From cdf6e6cd36a40af1df97e9e84c845ec7f319c07f Mon Sep 17 00:00:00 2001 From: ChristophTobler Date: Wed, 11 Oct 2017 15:15:06 +0200 Subject: [PATCH] EKF: use delta_time to avoid division by zero --- EKF/estimator_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/estimator_interface.cpp b/EKF/estimator_interface.cpp index 3b28b99297..3eedddf3a0 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -324,7 +324,7 @@ void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *fl optflow_sample_new.flowRadXYcomp(0) = optflow_sample_new.flowRadXY(0) - optflow_sample_new.gyroXYZ(0); optflow_sample_new.flowRadXYcomp(1) = optflow_sample_new.flowRadXY(1) - optflow_sample_new.gyroXYZ(1); // convert integration interval to seconds - optflow_sample_new.dt = 1e-6f * (float)flow->dt; + optflow_sample_new.dt = delta_time; _time_last_optflow = time_usec; // push to buffer _flow_buffer.push(optflow_sample_new);