From a9def8be93339d66c52047f609182561dd7f4c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 8 Oct 2018 13:53:51 +0200 Subject: [PATCH] MC land detector: remove LNDMC_THR_RANGE param - no airframe changes the default - it does not make much sense to be able to configure the 0.1 threshold but the 0.3 threshold for ground contact detection cannot be configured. --- .../land_detector/MulticopterLandDetector.cpp | 4 +--- .../land_detector/MulticopterLandDetector.h | 2 -- .../land_detector/land_detector_params_mc.c | 16 ---------------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index fc2cf4e1bf..78613afa27 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -75,7 +75,6 @@ MulticopterLandDetector::MulticopterLandDetector() _paramHandle.maxRotation = param_find("LNDMC_ROT_MAX"); _paramHandle.maxVelocity = param_find("LNDMC_XY_VEL_MAX"); _paramHandle.maxClimbRate = param_find("LNDMC_Z_VEL_MAX"); - _paramHandle.throttleRange = param_find("LNDMC_THR_RANGE"); _paramHandle.minThrottle = param_find("MPC_THR_MIN"); _paramHandle.hoverThrottle = param_find("MPC_THR_HOVER"); _paramHandle.minManThrottle = param_find("MPC_MANTHR_MIN"); @@ -121,7 +120,6 @@ void MulticopterLandDetector::_update_params() _params.maxRotation_rad_s = math::radians(_params.maxRotation_rad_s); param_get(_paramHandle.minThrottle, &_params.minThrottle); param_get(_paramHandle.hoverThrottle, &_params.hoverThrottle); - param_get(_paramHandle.throttleRange, &_params.throttleRange); param_get(_paramHandle.minManThrottle, &_params.minManThrottle); param_get(_paramHandle.freefall_acc_threshold, &_params.freefall_acc_threshold); param_get(_paramHandle.freefall_trigger_time, &_params.freefall_trigger_time); @@ -320,7 +318,7 @@ bool MulticopterLandDetector::_has_low_thrust() bool MulticopterLandDetector::_has_minimal_thrust() { // 10% of throttle range between min and hover once we entered ground contact - float sys_min_throttle = _params.minThrottle + (_params.hoverThrottle - _params.minThrottle) * _params.throttleRange; + float sys_min_throttle = _params.minThrottle + (_params.hoverThrottle - _params.minThrottle) * 0.1f; // Determine the system min throttle based on flight mode if (!_control_mode.flag_control_climb_rate_enabled) { diff --git a/src/modules/land_detector/MulticopterLandDetector.h b/src/modules/land_detector/MulticopterLandDetector.h index 3c3a3e2fa7..ea470cd501 100644 --- a/src/modules/land_detector/MulticopterLandDetector.h +++ b/src/modules/land_detector/MulticopterLandDetector.h @@ -101,7 +101,6 @@ private: param_t maxRotation; param_t minThrottle; param_t hoverThrottle; - param_t throttleRange; param_t minManThrottle; param_t freefall_acc_threshold; param_t freefall_trigger_time; @@ -115,7 +114,6 @@ private: float maxRotation_rad_s; float minThrottle; float hoverThrottle; - float throttleRange; float minManThrottle; float freefall_acc_threshold; float freefall_trigger_time; diff --git a/src/modules/land_detector/land_detector_params_mc.c b/src/modules/land_detector/land_detector_params_mc.c index 726a8f57d7..4f85ce311a 100644 --- a/src/modules/land_detector/land_detector_params_mc.c +++ b/src/modules/land_detector/land_detector_params_mc.c @@ -81,22 +81,6 @@ PARAM_DEFINE_FLOAT(LNDMC_ROT_MAX, 20.0f); */ PARAM_DEFINE_FLOAT(LNDMC_FFALL_THR, 2.0f); -/** - * Multicopter sub-hover throttle scaling - * - * The range between throttle_min and throttle_hover is scaled - * by this parameter to define how close to minimum throttle - * the current throttle value needs to be in order to get - * accepted as landed. - * - * @min 0.05 - * @max 0.5 - * @decimal 2 - * - * @group Land Detector - */ -PARAM_DEFINE_FLOAT(LNDMC_THR_RANGE, 0.1f); - /** * Multicopter free-fall trigger time *