diff --git a/libraries/AP_Landing/AP_Landing.cpp b/libraries/AP_Landing/AP_Landing.cpp index a250fe2911..f8f1006892 100644 --- a/libraries/AP_Landing/AP_Landing.cpp +++ b/libraries/AP_Landing/AP_Landing.cpp @@ -145,6 +145,15 @@ const AP_Param::GroupInfo AP_Landing::var_info[] = { // @User: Advanced AP_GROUPINFO("OPTIONS", 16, AP_Landing, _options, 0), + // @Param: FLARE_AIM + // @DisplayName: Flare aim point adjustment percentage. + // @Description: This parameter controls how much the aim point is moved to allow for the time spent in the flare manoeuvre. When set to 100% the aim point is adjusted on the assumption that the flare sink rate controller instantly achieves the sink rate set by TECS_LAND_SINK. when set to 0%, no aim point adjustment is made. If the plane consistently touches down short of the aim point reduce the parameter and vice verse. + // @Range: 0 100 + // @Units: % + // @Increment: 1 + // @User: Advanced + AP_GROUPINFO("FLARE_AIM", 17, AP_Landing, flare_effectivness_pct, 50), + // @Param: TYPE // @DisplayName: Auto-landing type // @Description: Specifies the auto-landing type to use diff --git a/libraries/AP_Landing/AP_Landing.h b/libraries/AP_Landing/AP_Landing.h index 7d25875d7c..0477bf4dbc 100644 --- a/libraries/AP_Landing/AP_Landing.h +++ b/libraries/AP_Landing/AP_Landing.h @@ -165,6 +165,7 @@ private: AP_Int8 flap_percent; AP_Int8 throttle_slewrate; AP_Int8 type; + AP_Int8 flare_effectivness_pct; // Land Type STANDARD GLIDE SLOPE diff --git a/libraries/AP_Landing/AP_Landing_Slope.cpp b/libraries/AP_Landing/AP_Landing_Slope.cpp index f482ccbbdb..0ca5f1aaa9 100644 --- a/libraries/AP_Landing/AP_Landing_Slope.cpp +++ b/libraries/AP_Landing/AP_Landing_Slope.cpp @@ -284,8 +284,9 @@ void AP_Landing::type_slope_setup_landing_glide_slope(const Location &prev_WP_lo } // calculate time spent in flare assuming the sink rate reduces over time from sink_rate at aim_height - // to tecs_controller->get_land_sinkrate() at touchdown with more reduction in sink rate initially - const float flare_sink_rate_avg = MAX(0.67f * tecs_Controller->get_land_sinkrate() + 0.33f * sink_rate, 0.1f); + // to tecs_controller->get_land_sinkrate() at touchdown + const float weight = constrain_float(0.01f*(float)flare_effectivness_pct, 0.0f, 1.0f); + const float flare_sink_rate_avg = MAX(weight * tecs_Controller->get_land_sinkrate() + (1.0f - weight) * sink_rate, 0.1f); const float flare_time = aim_height / flare_sink_rate_avg; // distance to flare is based on ground speed, adjusted as we