From 623bd6923ef7554ea5a0841391d37cbd215ca656 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 14 Dec 2020 16:58:13 +0900 Subject: [PATCH] AP_Proximity: LightwareSF40C_v09 uses update Boundary_3D interface --- .../AP_Proximity/AP_Proximity_LightWareSF40C_v09.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Proximity/AP_Proximity_LightWareSF40C_v09.cpp b/libraries/AP_Proximity/AP_Proximity_LightWareSF40C_v09.cpp index 4fc0c49d28..ea791a5d89 100644 --- a/libraries/AP_Proximity/AP_Proximity_LightWareSF40C_v09.cpp +++ b/libraries/AP_Proximity/AP_Proximity_LightWareSF40C_v09.cpp @@ -327,16 +327,15 @@ bool AP_Proximity_LightWareSF40C_v09::process_reply() _last_distance_received_ms = AP_HAL::millis(); success = true; // Get location on 3-D boundary based on angle to the object - const boundary_location bnd_loc = boundary.get_sector(angle_deg); - // reset this sector back to default, so that it can be filled with the fresh sensor data - boundary.reset_sector(bnd_loc); + const AP_Proximity_Boundary_3D::Face face = boundary.get_face(angle_deg); if (is_positive(distance_m)) { - boundary.set_attributes(bnd_loc, angle_deg, distance_m); + boundary.set_face_attributes(face, angle_deg, distance_m); // update OA database database_push(angle_deg, distance_m); + } else { + // invalidate distance of face + boundary.reset_face(face); } - // update boundary used for avoidance - boundary.update_boundary(bnd_loc); } break; }