diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-03 18:53:05 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-03 18:53:05 +0200 |
commit | 139ca8c327a80b61213e2d75dd8819cf119d22d7 (patch) | |
tree | 19e06c7a11e3aadef1a92b06c233959aca6e3a01 /src | |
parent | 2761f98ab639c6e3737829adef179b372d9facce (diff) | |
download | px4-firmware-139ca8c327a80b61213e2d75dd8819cf119d22d7.tar.gz px4-firmware-139ca8c327a80b61213e2d75dd8819cf119d22d7.tar.bz2 px4-firmware-139ca8c327a80b61213e2d75dd8819cf119d22d7.zip |
fw landing: impose horizontal limit for start of flare
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 6 |
1 files changed, 5 insertions, 1 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 84c14be01..e71e7a2ac 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 @@ -999,7 +999,11 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi float relative_alt = get_relative_landingalt(_pos_sp_triplet.current.alt, _global_pos.alt, _range_finder, _parameters.range_finder_rel_alt); - if ( (relative_alt < landingslope.flare_relative_alt()) || land_noreturn_vertical) { //checking for land_noreturn to avoid unwanted climb out + /* Check if we should start flaring with a vertical and a + * horizontal limit (with some tolerance) */ + if ( ((relative_alt < landingslope.flare_relative_alt()) && + (wp_distance < landingslope.flare_length() + 5.0f)) || + land_noreturn_vertical) { //checking for land_noreturn to avoid unwanted climb out /* land with minimal speed */ |