From 82920da2327533696fe879a6dc8dfc4d3bf32432 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Sat, 16 Apr 2016 13:56:50 +1000 Subject: [PATCH] EKF: strengthen checking of local position status provides immediate status reporting when dropping out of optical flow mode --- 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 876b3030e9..8a4f8fb6a1 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -364,5 +364,5 @@ void EstimatorInterface::unallocate_buffers() bool EstimatorInterface::local_position_is_valid() { // return true if the position estimate is valid - return ((_time_last_imu - _time_last_optflow) < 5e6) || global_position_is_valid(); + return (((_time_last_imu - _time_last_optflow) < 5e6) && _control_status.flags.opt_flow) || global_position_is_valid(); }