Plane: bypass arming checks for armed watchdog reboot

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

View File

@ -24,6 +24,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);
@ -106,3 +114,17 @@ bool AP_Arming_Plane::ins_checks(bool display_failure)
return true;
}
bool AP_Arming_Plane::arm_checks(ArmingMethod 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

@ -24,7 +24,8 @@ 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(ArmingMethod method) override;
ArmingRudder rudder_arming() const { return (ArmingRudder)rudder_arming_value.get(); }
@ -32,7 +33,7 @@ public:
static const struct AP_Param::GroupInfo var_info[];
protected:
bool ins_checks(bool report);
bool ins_checks(bool report) override;
// parameters
AP_Int8 rudder_arming_value;