mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_NavEKF: make AP_RANGEFINDER_ENABLED remove more code
This commit is contained in:
parent
13e7d04497
commit
07e76a7cae
@ -486,9 +486,16 @@ bool AP_NavEKF_Source::pre_arm_check(bool requires_position, char *failure_msg,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rangefinder_required && (dal.rangefinder() == nullptr || !dal.rangefinder()->has_orientation(ROTATION_PITCH_270))) {
|
if (rangefinder_required) {
|
||||||
hal.util->snprintf(failure_msg, failure_msg_len, ekf_requires_msg, "RangeFinder");
|
#if AP_RANGEFINDER_ENABLED
|
||||||
return false;
|
const bool have_rangefinder = (dal.rangefinder() != nullptr && dal.rangefinder()->has_orientation(ROTATION_PITCH_270));
|
||||||
|
#else
|
||||||
|
const bool have_rangefinder = false;
|
||||||
|
#endif
|
||||||
|
if (!have_rangefinder) {
|
||||||
|
hal.util->snprintf(failure_msg, failure_msg_len, ekf_requires_msg, "RangeFinder");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visualodom_required) {
|
if (visualodom_required) {
|
||||||
|
Loading…
Reference in New Issue
Block a user