LandDetectorMC: enforce that LNDMC_Z_VEL_MAX is larger than MPC_LAND_CRWL/MPC_LAND_SPEED (#20614)

* LandDetectorMC: enforce that LNDMC_Z_VEL_MAX * 1.2 is below *MPC_LAND_CRWL/MPC_LAND_SPEED

Otherwise the _in_descend flag doesn't get set correctly during the last part
of the landing, where the descend speed is at MPC_LAND_CRWL or LAND_SPEED.
The _in_descend flag is set it the velocity setpoint is >1.1*LNDMC_Z_VEL_MAX.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
Silvan Fuhrer
2022-11-17 10:56:26 +01:00
committed by GitHub
co-authored by Matthias Grob
parent e58ad581a0
commit 798cc4f01c
3 changed files with 24 additions and 5 deletions
@@ -87,12 +87,13 @@ private:
/** Distance above ground below which entering ground contact state is possible when distance to ground is available. */
static constexpr float DIST_FROM_GROUND_THRESHOLD = 1.0f;
/** Handles for interesting parameters. **/
struct {
param_t minThrottle;
param_t hoverThrottle;
param_t minManThrottle;
param_t useHoverThrustEstimate;
param_t landSpeed;
param_t crawlSpeed;
} _paramHandle{};
struct {
@@ -100,6 +101,8 @@ private:
float hoverThrottle;
float minManThrottle;
bool useHoverThrustEstimate;
float landSpeed;
float crawlSpeed;
} _params{};
uORB::Subscription _actuator_controls_sub{ORB_ID(actuator_controls_0)};