Plane: add ahrs health pre-arm check
This commit is contained in:
parent
09aef3a3b8
commit
073828a764
@ -127,6 +127,8 @@ public:
|
||||
|
||||
// var_info for holding Parameter information
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
protected:
|
||||
bool ins_checks(bool report);
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -63,3 +63,29 @@ bool AP_Arming_Plane::pre_arm_checks(bool report)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool AP_Arming_Plane::ins_checks(bool report)
|
||||
{
|
||||
// call parent class checks
|
||||
if (!AP_Arming::ins_checks(report)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// additional plane specific checks
|
||||
if ((checks_to_perform & ARMING_CHECK_ALL) ||
|
||||
(checks_to_perform & ARMING_CHECK_INS)) {
|
||||
if (!ahrs.healthy()) {
|
||||
if (report) {
|
||||
const char *reason = ahrs.prearm_failure_reason();
|
||||
if (reason) {
|
||||
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, PSTR("PreArm: %s"), reason);
|
||||
} else {
|
||||
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, PSTR("PreArm: AHRS not healthy"));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user