mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
Plane: disallow mavlink disarm while flying
this relies on is_flying(), and we will need to watch for reports of the heuristics failing
This commit is contained in:
parent
a71b406287
commit
e0e60c8654
@ -275,12 +275,15 @@ bool AP_Arming_Plane::arm(const AP_Arming::Method method, const bool do_arming_c
|
|||||||
bool AP_Arming_Plane::disarm(const AP_Arming::Method method, bool do_disarm_checks)
|
bool AP_Arming_Plane::disarm(const AP_Arming::Method method, bool do_disarm_checks)
|
||||||
{
|
{
|
||||||
if (do_disarm_checks &&
|
if (do_disarm_checks &&
|
||||||
method == AP_Arming::Method::RUDDER) {
|
(method == AP_Arming::Method::MAVLINK ||
|
||||||
// don't allow rudder-disarming in flight:
|
method == AP_Arming::Method::RUDDER)) {
|
||||||
if (plane.is_flying()) {
|
if (plane.is_flying()) {
|
||||||
// obviously this could happen in-flight so we can't warn about it
|
// don't allow mavlink or rudder disarm while flying
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (do_disarm_checks && method == AP_Arming::Method::RUDDER) {
|
||||||
// option must be enabled:
|
// option must be enabled:
|
||||||
if (get_rudder_arming_type() != AP_Arming::RudderArming::ARMDISARM) {
|
if (get_rudder_arming_type() != AP_Arming::RudderArming::ARMDISARM) {
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "Rudder disarm: disabled");
|
gcs().send_text(MAV_SEVERITY_INFO, "Rudder disarm: disabled");
|
||||||
|
Loading…
Reference in New Issue
Block a user