mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-24 09:38:29 -04:00
ArduPlane: add do_disarm_checks boolean to disarm call
this creates symmetry between arming and disarming, at least as far as the top-level arm() and disarm() calls are concerned.
This commit is contained in:
parent
65adf5b4a9
commit
b698546b70
@ -230,9 +230,10 @@ bool AP_Arming_Plane::arm(const AP_Arming::Method method, const bool do_arming_c
|
|||||||
/*
|
/*
|
||||||
disarm motors
|
disarm motors
|
||||||
*/
|
*/
|
||||||
bool AP_Arming_Plane::disarm(const AP_Arming::Method method)
|
bool AP_Arming_Plane::disarm(const AP_Arming::Method method, bool do_disarm_checks)
|
||||||
{
|
{
|
||||||
if (method == AP_Arming::Method::RUDDER) {
|
if (do_disarm_checks &&
|
||||||
|
method == AP_Arming::Method::RUDDER) {
|
||||||
// don't allow rudder-disarming in flight:
|
// don't allow rudder-disarming in flight:
|
||||||
if (plane.is_flying()) {
|
if (plane.is_flying()) {
|
||||||
// obviously this could happen in-flight so we can't warn about it
|
// obviously this could happen in-flight so we can't warn about it
|
||||||
@ -245,7 +246,7 @@ bool AP_Arming_Plane::disarm(const AP_Arming::Method method)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AP_Arming::disarm(method)) {
|
if (!AP_Arming::disarm(method, do_disarm_checks)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (plane.control_mode != &plane.mode_auto) {
|
if (plane.control_mode != &plane.mode_auto) {
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
// var_info for holding Parameter information
|
// var_info for holding Parameter information
|
||||||
static const struct AP_Param::GroupInfo var_info[];
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
bool disarm(AP_Arming::Method method) override;
|
bool disarm(AP_Arming::Method method, bool do_disarm_checks=true) override;
|
||||||
bool arm(AP_Arming::Method method, bool do_arming_checks=true) override;
|
bool arm(AP_Arming::Method method, bool do_arming_checks=true) override;
|
||||||
|
|
||||||
void update_soft_armed();
|
void update_soft_armed();
|
||||||
|
Loading…
Reference in New Issue
Block a user