AP_Arming: add mandatory_checks

These are checks that can never be bypassed
This commit is contained in:
Randy Mackay 2019-11-29 15:18:19 +09:00 committed by Andrew Tridgell
parent d4680e277f
commit 7b01fda8f8
2 changed files with 4 additions and 1 deletions

View File

@ -872,7 +872,7 @@ bool AP_Arming::arm(AP_Arming::Method method, const bool do_arming_checks)
return false;
}
if (!do_arming_checks || (pre_arm_checks(true) && arm_checks(method))) {
if ((!do_arming_checks && mandatory_checks(true)) || (pre_arm_checks(true) && arm_checks(method))) {
armed = true;
//TODO: Log motor arming

View File

@ -133,6 +133,9 @@ protected:
bool servo_checks(bool report) const;
bool rc_checks_copter_sub(bool display_failure, const RC_Channel *channels[4]) const;
// mandatory checks that cannot be bypassed. This function will only be called if ARMING_CHECK is zero or arming forced
virtual bool mandatory_checks(bool report) { return true; }
// returns true if a particular check is enabled
bool check_enabled(const enum AP_Arming::ArmingChecks check) const;
// returns a mavlink severity which should be used if a specific check fails