From 8e586bc67d3d1ecc55aa714e33463cd3dee057c9 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 10 Jul 2020 03:04:26 +0530 Subject: [PATCH] AP_Proximity: Check for valid reading before pushing to OA DB --- libraries/AP_Proximity/AP_Proximity_Backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Proximity/AP_Proximity_Backend.cpp b/libraries/AP_Proximity/AP_Proximity_Backend.cpp index 2cacecd5e3..9ae184c4d5 100644 --- a/libraries/AP_Proximity/AP_Proximity_Backend.cpp +++ b/libraries/AP_Proximity/AP_Proximity_Backend.cpp @@ -174,7 +174,7 @@ void AP_Proximity_Backend::update_boundary_for_sector(const uint8_t sector, cons return; } - if (push_to_OA_DB) { + if (push_to_OA_DB && _distance_valid[sector]) { database_push(_angle[sector], _distance[sector]); }