LCOV - code coverage report
Current view: top level - AP_Proximity - AP_Proximity_RangeFinder.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 2 0.0 %
Date: 2026-09-09 11:02:08 Functions: 0 2 0.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "AP_Proximity_config.h"
       4             : 
       5             : #if AP_PROXIMITY_RANGEFINDER_ENABLED
       6             : 
       7             : #include "AP_Proximity_Backend.h"
       8             : 
       9             : #define PROXIMITY_RANGEFIDER_TIMEOUT_MS 200 // requests timeout after 0.2 seconds
      10             : 
      11             : class AP_Proximity_RangeFinder : public AP_Proximity_Backend
      12             : {
      13             : 
      14             : public:
      15             :     // constructor
      16             :     using AP_Proximity_Backend::AP_Proximity_Backend;
      17             : 
      18             :     // update state
      19             :     void update(void) override;
      20             : 
      21             :     // get maximum and minimum distances (in meters) of sensor
      22           0 :     float distance_max_m() const override { return _distance_max; }
      23           0 :     float distance_min_m() const override { return _distance_min; }
      24             : 
      25             :     // get distance upwards in meters. returns true on success
      26             :     bool get_upward_distance(float &distance) const override;
      27             : 
      28             : private:
      29             : 
      30             :     // horizontal distance support
      31             :     uint32_t _last_update_ms;   // system time of last RangeFinder reading
      32             :     float _distance_max;        // max range of sensor in meters
      33             :     float _distance_min;        // min range of sensor in meters
      34             : 
      35             :     // upward distance support
      36             :     uint32_t _last_upward_update_ms;    // system time of last update distance
      37             :     float _distance_upward = -1;        // upward distance in meters, negative if the last reading was out of range
      38             : };
      39             : 
      40             : #endif // AP_PROXIMITY_RANGEFINDER_ENABLED

Generated by: LCOV version 1.14