From 15823d9e97a87afda4f50a7a0c9b9b28022cf529 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 2 Aug 2018 21:25:58 -0400 Subject: [PATCH] AP_LANDING_GEAR: Remove deploy lock Since the RC switches only respond to changes, there is no longer a need for this lock state. The gear can be retracted or deployed by RC switch, flight mode, or mavlink command freely without convoluted unlocking methods. Also removed use of this in the associated Copter code. --- ArduCopter/landing_gear.cpp | 2 +- libraries/AP_LandingGear/AP_LandingGear.cpp | 9 +-------- libraries/AP_LandingGear/AP_LandingGear.h | 2 -- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/ArduCopter/landing_gear.cpp b/ArduCopter/landing_gear.cpp index 4db9470469..ca19cc1fca 100644 --- a/ArduCopter/landing_gear.cpp +++ b/ArduCopter/landing_gear.cpp @@ -15,7 +15,7 @@ void Copter::landinggear_update() // if we are doing an automatic landing procedure, force the landing gear to deploy. // To-Do: should we pause the auto-land procedure to give time for gear to come down? if (flightmode->landing_gear_should_be_deployed()) { - landinggear.set_position(AP_LandingGear::LandingGear_Deploy_And_Keep_Deployed); + landinggear.set_position(AP_LandingGear::LandingGear_Deploy); } // send event message to datalog if status has changed diff --git a/libraries/AP_LandingGear/AP_LandingGear.cpp b/libraries/AP_LandingGear/AP_LandingGear.cpp index 51350ce783..ee91564c29 100644 --- a/libraries/AP_LandingGear/AP_LandingGear.cpp +++ b/libraries/AP_LandingGear/AP_LandingGear.cpp @@ -58,17 +58,10 @@ void AP_LandingGear::set_position(LandingGearCommand cmd) { switch (cmd) { case LandingGear_Retract: - if (!_deploy_lock) { - retract(); - } + retract(); break; case LandingGear_Deploy: deploy(); - _deploy_lock = false; - break; - case LandingGear_Deploy_And_Keep_Deployed: - deploy(); - _deploy_lock = true; break; } } diff --git a/libraries/AP_LandingGear/AP_LandingGear.h b/libraries/AP_LandingGear/AP_LandingGear.h index f1216eb100..829efef24a 100644 --- a/libraries/AP_LandingGear/AP_LandingGear.h +++ b/libraries/AP_LandingGear/AP_LandingGear.h @@ -25,7 +25,6 @@ public: enum LandingGearCommand { LandingGear_Retract, LandingGear_Deploy, - LandingGear_Deploy_And_Keep_Deployed, }; // Gear command modes @@ -54,7 +53,6 @@ private: // internal variables bool _deployed; // true if the landing gear has been deployed, initialized false - bool _deploy_lock; // used to force landing gear to remain deployed until another regular Deploy command is received to reduce accidental retraction /// retract - retract landing gear void retract();