mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 04:13:34 +08:00
mag check: do not require mag 0
sys_has_mag defines the required number of mags; if one mag is needed, it can be any instance, not necessarily mag 0
This commit is contained in:
committed by
Mathieu Bresciani
parent
e3fd50667d
commit
fe5c887895
@@ -47,9 +47,6 @@ void MagnetometerChecks::checkAndReport(const Context &context, Report &reporter
|
||||
int num_enabled_and_valid_calibration = 0;
|
||||
|
||||
for (int instance = 0; instance < _sensor_mag_sub.size(); instance++) {
|
||||
bool is_mag_fault = false;
|
||||
const bool is_required = instance == 0 || isMagRequired(instance, is_mag_fault);
|
||||
|
||||
const bool exists = _sensor_mag_sub[instance].advertised();
|
||||
bool is_valid = false;
|
||||
bool is_calibration_valid = false;
|
||||
@@ -80,7 +77,9 @@ void MagnetometerChecks::checkAndReport(const Context &context, Report &reporter
|
||||
}
|
||||
|
||||
// Do not raise errors if a mag is not required
|
||||
if (!is_required) {
|
||||
bool is_mag_fault = false;
|
||||
|
||||
if (!isMagRequired(instance, is_mag_fault)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user