From f95fb0f20f5a5ad2614dc8ae85779e1316098b8c Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 29 Dec 2016 17:44:44 +0100 Subject: [PATCH] land detector: commented takeoff throttle values for each mode --- src/modules/land_detector/MulticopterLandDetector.cpp | 7 +++++++ src/modules/land_detector/MulticopterLandDetector.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index 4c08ae0a70..d1cfa38422 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -239,14 +239,21 @@ bool MulticopterLandDetector::_get_landed_state() float MulticopterLandDetector::get_takeoff_throttle() { + /* Position mode */ if (_control_mode.flag_control_manual_enabled && _control_mode.flag_control_position_enabled) { + /* Should be above 0.5 because below that we do not gain altitude and won't take off. + * Also it should be quite high such that we don't accidentally take off when using + * a spring loaded throttle and have a useful vertical speed to start with. */ return 0.75f; } + /* Manual/attitude mode */ if (_control_mode.flag_control_manual_enabled && _control_mode.flag_control_attitude_enabled) { + /* Should be quite low and certainly below hover throttle because pilot controls throttle manually. */ return 0.15f; } + /* As default for example in acro mode we do not want to stay landed. */ return 0.0f; } diff --git a/src/modules/land_detector/MulticopterLandDetector.h b/src/modules/land_detector/MulticopterLandDetector.h index b66130c4bf..080194c3e6 100644 --- a/src/modules/land_detector/MulticopterLandDetector.h +++ b/src/modules/land_detector/MulticopterLandDetector.h @@ -116,7 +116,7 @@ private: uint64_t _min_trust_start; ///< timestamp when minimum trust was applied first uint64_t _arming_time; - // get pilot throttle threshold with which we should quit landed state and take off + /* get control mode dependent pilot throttle threshold with which we should quit landed state and take off */ float get_takeoff_throttle(); };