Rover: disallow arming in RTL and S_RTL mode

This commit is contained in:
Rishabh 2020-02-06 15:37:10 +05:30 committed by Randy Mackay
parent 999061704e
commit 961eeb3b58
2 changed files with 13 additions and 1 deletions

View File

@ -86,7 +86,8 @@ bool AP_Arming_Rover::pre_arm_checks(bool report)
& rover.g2.motors.pre_arm_check(report)
& fence_checks(report)
& oa_check(report)
& parameter_checks(report));
& parameter_checks(report)
& mode_checks(report));
}
bool AP_Arming_Rover::arm_checks(AP_Arming::Method method)
@ -185,3 +186,13 @@ bool AP_Arming_Rover::parameter_checks(bool report)
return true;
}
// check if arming allowed from this mode
bool AP_Arming_Rover::mode_checks(bool report)
{
//display failure if arming in this mode is not allowed
if (!rover.control_mode->allows_arming()) {
check_failed(report, "Mode not armable");
return false;
}
return true;
}

View File

@ -30,5 +30,6 @@ protected:
// the following check functions do not call into AP_Arming
bool oa_check(bool report);
bool parameter_checks(bool report);
bool mode_checks(bool report);
};