From 334aa57a5f21bc9b394e58c73054d0a04dc99e21 Mon Sep 17 00:00:00 2001 From: Philipp Oettershagen Date: Wed, 20 Jun 2018 19:40:53 +0200 Subject: [PATCH] Fixed-wing autoland: Remove the dynamic altitude acceptance calculation and just use a simple separate landing altitude acceptance radius instead. This gives users that do not use LOITER-TO-ALT waypoints more control over their landing procedure --- src/modules/navigator/navigator.h | 2 ++ src/modules/navigator/navigator_main.cpp | 8 ++------ src/modules/navigator/navigator_params.c | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/modules/navigator/navigator.h b/src/modules/navigator/navigator.h index 22dda8bede..f362c86922 100644 --- a/src/modules/navigator/navigator.h +++ b/src/modules/navigator/navigator.h @@ -345,6 +345,8 @@ private: (ParamFloat) _param_acceptance_radius, /**< acceptance for takeoff */ (ParamFloat) _param_fw_alt_acceptance_radius, /**< acceptance radius for fixedwing altitude */ + (ParamFloat) + _param_fw_alt_lnd_acceptance_radius, /**< acceptance radius for fixedwing altitude before landing*/ (ParamFloat) _param_mc_alt_acceptance_radius, /**< acceptance radius for multicopter altitude */ (ParamInt) _param_force_vtol, /**< acceptance radius for multicopter altitude */ diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 3bfec7f0d9..ec48a4c31b 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -868,15 +868,11 @@ float Navigator::get_altitude_acceptance_radius() { if (!get_vstatus()->is_rotary_wing) { - // The fixed-wing altitude acceptance radius default is the respective parameter. However, before a landing - // approach it needs to be tighter: Assume a 30% error w.r.t. the remaining descent altitude is OK, but enforce - // min/max values (e.g. min=3m to make sure that the waypoint can still be reached in case of wrong user input). - const position_setpoint_s &next_sp = get_position_setpoint_triplet()->next; - const position_setpoint_s &curr_sp = get_position_setpoint_triplet()->current; if (next_sp.type == position_setpoint_s::SETPOINT_TYPE_LAND && next_sp.valid) { - return math::constrain(0.3f * (curr_sp.alt - next_sp.alt), 3.0f, _param_fw_alt_acceptance_radius.get()); + // Use separate (tighter) altitude acceptance for clean altitude starting point before landing + return _param_fw_alt_lnd_acceptance_radius.get(); } } diff --git a/src/modules/navigator/navigator_params.c b/src/modules/navigator/navigator_params.c index c5a5981fa4..c7012bc440 100644 --- a/src/modules/navigator/navigator_params.c +++ b/src/modules/navigator/navigator_params.c @@ -83,6 +83,20 @@ PARAM_DEFINE_FLOAT(NAV_ACC_RAD, 10.0f); */ PARAM_DEFINE_FLOAT(NAV_FW_ALT_RAD, 10.0f); +/** + * FW Altitude Acceptance Radius before a landing + * + * Altitude acceptance used for the last waypoint before a fixed-wing landing. This is usually smaller + * than the standard vertical acceptance because close to the ground higher accuracy is required. + * + * @unit m + * @min 0.05 + * @max 200.0 + * @decimal 1 + * @group Mission + */ +PARAM_DEFINE_FLOAT(NAV_FW_ALTL_RAD, 5.0f); + /** * MC Altitude Acceptance Radius *