Copter: pre-arm check primary compass health

Previously we would check the 1st compass which might not necessarily be
the primary compass
This commit is contained in:
Randy Mackay 2015-04-10 09:30:14 +09:00
parent 9268024094
commit 52f7186cbf
2 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan)
if (barometer.all_healthy()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
}
if (g.compass_enabled && compass.healthy(0) && ahrs.use_compass()) {
if (g.compass_enabled && compass.healthy() && ahrs.use_compass()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_MAG;
}
if (gps.status() > AP_GPS::NO_GPS) {

View File

@ -258,7 +258,7 @@ static bool pre_arm_checks(bool display_failure)
// check Compass
if ((g.arming_check == ARMING_CHECK_ALL) || (g.arming_check & ARMING_CHECK_COMPASS)) {
// check the primary compass is healthy
if(!compass.healthy(0)) {
if(!compass.healthy()) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Compass not healthy"));
}