diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp index a56114ba99..44edc6505d 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp @@ -88,6 +88,11 @@ void AP_ExternalAHRS::init(void) } } +bool AP_ExternalAHRS::enabled() const +{ + return DevType(devtype) != DevType::None; +} + // get serial port number for the uart, or -1 if not applicable int8_t AP_ExternalAHRS::get_port(void) const { diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h index 544191c413..41664c37c2 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.h @@ -75,6 +75,7 @@ public: } state; // accessors for AP_AHRS + bool enabled() const; bool healthy(void) const; bool initialised(void) const; bool get_quaternion(Quaternion &quat);