AP_RangeFinder: added get_type() API

This commit is contained in:
Andrew Tridgell 2020-01-25 10:58:15 +11:00
parent 7efd5248ee
commit 2fa6f534ab

View File

@ -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;