Browse Source

AP_Arming: add mandatory_checks

These are checks that can never be bypassed
master
Randy Mackay 5 years ago
parent
commit
e28f258297
  1. 2
      libraries/AP_Arming/AP_Arming.cpp
  2. 3
      libraries/AP_Arming/AP_Arming.h

2
libraries/AP_Arming/AP_Arming.cpp

@ -872,7 +872,7 @@ bool AP_Arming::arm(AP_Arming::Method method, const bool do_arming_checks) @@ -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

3
libraries/AP_Arming/AP_Arming.h

@ -133,6 +133,9 @@ protected: @@ -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

Loading…
Cancel
Save