diff --git a/libraries/AP_RangeFinder/AP_RangeFinder.h b/libraries/AP_RangeFinder/AP_RangeFinder.h index 675c7a00be..5a9831b6b4 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder.h +++ b/libraries/AP_RangeFinder/AP_RangeFinder.h @@ -139,6 +139,11 @@ public: AP_RangeFinder_Backend *get_backend(uint8_t id) const; + // get rangefinder type for an ID + Type get_type(uint8_t id) const { + return id >= RANGEFINDER_MAX_INSTANCES? Type::NONE : Type(params[id].type.get()); + } + // methods to return a distance on a particular orientation from // any sensor which can current supply it uint16_t distance_cm_orient(enum Rotation orientation) const;