mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-25 01:03:59 -04:00
AP_NavEKF: add and use AP_BEACON_ENABLED
This commit is contained in:
parent
5cb6906968
commit
88e164aed3
@ -443,10 +443,17 @@ bool AP_NavEKF_Source::pre_arm_check(bool requires_position, char *failure_msg,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (beacon_required && (dal.beacon() == nullptr || !dal.beacon()->enabled())) {
|
||||
if (beacon_required) {
|
||||
#if AP_BEACON_ENABLED
|
||||
const bool beacon_available = (dal.beacon() != nullptr && dal.beacon()->enabled());
|
||||
#else
|
||||
const bool beacon_available = false;
|
||||
#endif
|
||||
if (!beacon_available) {
|
||||
hal.util->snprintf(failure_msg, failure_msg_len, ekf_requires_msg, "Beacon");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (compass_required && (dal.compass().get_num_enabled() == 0)) {
|
||||
hal.util->snprintf(failure_msg, failure_msg_len, ekf_requires_msg, "Compass");
|
||||
|
Loading…
Reference in New Issue
Block a user