AP_ExternalAHRS: add enabled method

This commit is contained in:
Iampete1 2022-12-21 13:25:05 +00:00 committed by Andrew Tridgell
parent f933f148ed
commit 33b09ff0cb
2 changed files with 6 additions and 0 deletions

View File

@ -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 // get serial port number for the uart, or -1 if not applicable
int8_t AP_ExternalAHRS::get_port(void) const int8_t AP_ExternalAHRS::get_port(void) const
{ {

View File

@ -75,6 +75,7 @@ public:
} state; } state;
// accessors for AP_AHRS // accessors for AP_AHRS
bool enabled() const;
bool healthy(void) const; bool healthy(void) const;
bool initialised(void) const; bool initialised(void) const;
bool get_quaternion(Quaternion &quat); bool get_quaternion(Quaternion &quat);