From d9764f2ef4c1955c63ee4c80f98e891e9b1c6de2 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 25 Oct 2022 00:00:34 +0200 Subject: [PATCH] MulticopterLandDetector: rename vertical velocity threshold variable --- src/modules/land_detector/MulticopterLandDetector.cpp | 6 +++--- src/modules/land_detector/land_detector_params_mc.c | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index 99a6638c20..c021e78164 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -152,13 +152,13 @@ bool MulticopterLandDetector::_get_ground_contact_state() // vertical speed is often deteriorated when on the ground or due to propeller // up/down throttling. - float max_vertical_velocity = _param_lndmc_z_vel_max.get(); + float vertical_velocity_threshold = _param_lndmc_z_vel_max.get(); if (_maybe_landed_hysteresis.get_state()) { - max_vertical_velocity *= 2.5f; + vertical_velocity_threshold *= 2.5f; } - _vertical_movement = (fabsf(_vehicle_local_position.vz) > max_vertical_velocity); + _vertical_movement = (fabsf(_vehicle_local_position.vz) > vertical_velocity_threshold); } else { _vertical_movement = true; diff --git a/src/modules/land_detector/land_detector_params_mc.c b/src/modules/land_detector/land_detector_params_mc.c index d3db8a38c8..889085e79e 100644 --- a/src/modules/land_detector/land_detector_params_mc.c +++ b/src/modules/land_detector/land_detector_params_mc.c @@ -48,11 +48,12 @@ PARAM_DEFINE_FLOAT(LNDMC_TRIG_TIME, 1.0f); /** - * Multicopter max climb rate + * Multicopter vertical velocity threshold * - * Maximum vertical velocity allowed in the landed state. - * Should be set lower than MPC_LAND_SPEED (and MPC_LAND_CRWL - * if distance sensor is present). + * Vertical velocity threshold to detect landing. + * Should be set lower than the expected minimal speed for landing + * so MPC_LAND_SPEED for autonomous landing and MPC_LAND_CRWL + * if distance sensor is present and slowing down close to ground. * * @unit m/s * @decimal 1