Plane: bypass arming checks for armed watchdog reboot

This commit is contained in:
Andrew Tridgell 2019-04-22 11:12:12 +10:00
parent 9c6c4101c9
commit ebbe01bd83
2 changed files with 25 additions and 2 deletions

View File

@ -19,6 +19,14 @@ const AP_Param::GroupInfo AP_Arming_Plane::var_info[] = {
*/
bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
{
if (hal.util->was_watchdog_armed()) {
// on watchdog reset bypass arming checks to allow for
// in-flight arming if we were armed before the reset. This
// allows a reset on a BVLOS flight to return home if the
// operator can command arming over telemetry
return true;
}
// call parent class checks
bool ret = AP_Arming::pre_arm_checks(display_failure);
@ -117,3 +125,17 @@ bool AP_Arming_Plane::ins_checks(bool display_failure)
return true;
}
bool AP_Arming_Plane::arm_checks(AP_Arming::Method method)
{
if (hal.util->was_watchdog_armed()) {
// on watchdog reset bypass arming checks to allow for
// in-flight arming if we were armed before the reset. This
// allows a reset on a BVLOS flight to return home if the
// operator can command arming over telemetry
gcs().send_text(MAV_SEVERITY_WARNING, "watchdog: Bypassing arming checks");
return true;
}
// call parent class checks
return AP_Arming::arm_checks(method);
}

View File

@ -18,12 +18,13 @@ public:
AP_Arming_Plane(const AP_Arming_Plane &other) = delete;
AP_Arming_Plane &operator=(const AP_Arming_Plane&) = delete;
bool pre_arm_checks(bool report);
bool pre_arm_checks(bool report) override;
bool arm_checks(AP_Arming::Method method) override;
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];
protected:
bool ins_checks(bool report);
bool ins_checks(bool report) override;
};