From 0bd23dd7c5511446451a491424ea58d296b9ca4b Mon Sep 17 00:00:00 2001 From: tumbili Date: Mon, 19 Oct 2015 13:56:53 +0200 Subject: [PATCH] only go into heading hold mode after flaring --- src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index b608ea7f9e..122ce0fdda 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -1227,8 +1227,9 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi wp_distance_save = 0.0f; } - //warnx("wp dist: %d, alt err: %d, noret: %s", (int)wp_distance, (int)altitude_error, (land_noreturn) ? "YES" : "NO"); - if (wp_distance < _parameters.land_heading_hold_horizontal_distance || land_noreturn_horizontal) { + // we want the plane to keep tracking the desired flight path until we start flaring + // if we go into heading hold mode earlier then we risk to be pushed away from the runway by cross winds + if (land_noreturn_vertical) { /* heading hold, along the line connecting this and the last waypoint */