LCOV - code coverage report
Current view: top level - home/pbarker/rc/ardupilot/ArduCopter - avoidance.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 8 8 100.0 %
Date: 2026-09-09 11:02:08 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "Copter.h"
       2             : 
       3             : // check if proximity type Simple Avoidance should be enabled based on alt
       4      228158 : void Copter::low_alt_avoidance()
       5             : {
       6             : #if AP_AVOIDANCE_ENABLED
       7             :     float alt_m;
       8      228158 :     if (!get_rangefinder_height_interpolated_m(alt_m)) {
       9             :         // enable avoidance if we don't have a valid rangefinder reading
      10      216680 :         avoid.proximity_alt_avoidance_enable(true);
      11      216680 :         return;
      12             :     }
      13             : 
      14       11478 :     bool enable_avoidance = true;
      15       11478 :     if (alt_m < avoid.get_min_alt()) {
      16         364 :         enable_avoidance = false;
      17             :     }
      18       11478 :     avoid.proximity_alt_avoidance_enable(enable_avoidance);
      19             : #endif
      20             : }

Generated by: LCOV version 1.14