From 8a1fa0e096ff6be73c95bfcf17c58700da3db572 Mon Sep 17 00:00:00 2001 From: rishabsingh3003 Date: Sun, 3 Sep 2023 23:11:52 -0400 Subject: [PATCH] Copter: Allow fast descend while Prec Landing --- ArduCopter/mode.cpp | 2 +- libraries/AC_PrecLand/AC_PrecLand.cpp | 2 +- libraries/AC_PrecLand/AC_PrecLand.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/mode.cpp b/ArduCopter/mode.cpp index d1e0822b20..888bb87025 100644 --- a/ArduCopter/mode.cpp +++ b/ArduCopter/mode.cpp @@ -666,7 +666,7 @@ void Mode::land_run_vertical_control(bool pause_descent) // doing precland but too far away from the obstacle // do not descend cmb_rate = 0.0f; - } else if (target_pos_meas.z > 35.0f && target_pos_meas.z < 200.0f) { + } else if (target_pos_meas.z > 35.0f && target_pos_meas.z < 200.0f && !copter.precland.do_fast_descend()) { // very close to the ground and doing prec land, lets slow down to make sure we land on target // compute desired descent velocity const float precland_acceptable_error_cm = 15.0f; diff --git a/libraries/AC_PrecLand/AC_PrecLand.cpp b/libraries/AC_PrecLand/AC_PrecLand.cpp index 3b849beb6c..7019898b14 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.cpp +++ b/libraries/AC_PrecLand/AC_PrecLand.cpp @@ -178,7 +178,7 @@ const AP_Param::GroupInfo AC_PrecLand::var_info[] = { // @Param: OPTIONS // @DisplayName: Precision Landing Extra Options // @Description: Precision Landing Extra Options - // @Bitmask: 0: Moving Landing Target, 1: Allow Precision Landing after manual reposition, 2: Do not slow vertical speed in final descend phase + // @Bitmask: 0: Moving Landing Target, 1: Allow Precision Landing after manual reposition, 2: Maintain high speed in final descent // @User: Advanced AP_GROUPINFO("OPTIONS", 17, AC_PrecLand, _options, 0), diff --git a/libraries/AC_PrecLand/AC_PrecLand.h b/libraries/AC_PrecLand/AC_PrecLand.h index aeaa44790d..d7d866369d 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.h +++ b/libraries/AC_PrecLand/AC_PrecLand.h @@ -114,7 +114,7 @@ public: AC_PrecLand_StateMachine::RetryAction get_retry_behaviour() const { return static_cast(_retry_behave.get()); } bool allow_precland_after_reposition() const { return _options & PLND_OPTION_PRECLAND_AFTER_REPOSITION; } - bool do_fast_descend() const {return _options & PLND_OPTION_FAST_DESCEND; } + bool do_fast_descend() const { return _options & PLND_OPTION_FAST_DESCEND; } // parameter var table static const struct AP_Param::GroupInfo var_info[];