diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-11-06 14:43:29 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-11-06 14:43:29 +0100 |
commit | 56aa8c7e8d5c6c4ebd4afabfdda4493db1d9290e (patch) | |
tree | c36c6541b3028632b50d465a53d9e44324e33f07 /src/modules/fw_pos_control_l1 | |
parent | 7ad907e638103065051b2b857874588b41766ca8 (diff) | |
download | px4-firmware-56aa8c7e8d5c6c4ebd4afabfdda4493db1d9290e.tar.gz px4-firmware-56aa8c7e8d5c6c4ebd4afabfdda4493db1d9290e.tar.bz2 px4-firmware-56aa8c7e8d5c6c4ebd4afabfdda4493db1d9290e.zip |
Minor fixes for motor off case
Diffstat (limited to 'src/modules/fw_pos_control_l1')
-rw-r--r-- | src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 8 |
1 files changed, 4 insertions, 4 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 413474a6e..b4edb0b36 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 @@ -820,7 +820,7 @@ FixedwingPositionControl::control_position(const math::Vector2f ¤t_positio float L_altitude = getLandingSlopeAbsoluteAltitude(L_wp_distance, _global_triplet.current.altitude, landing_slope_angle_rad, horizontal_slope_displacement); float landing_slope_alt_desired = getLandingSlopeAbsoluteAltitude(wp_distance, _global_triplet.current.altitude, landing_slope_angle_rad, horizontal_slope_displacement); - if (_global_pos.alt < _global_triplet.current.altitude + flare_relative_alt || land_noreturn_vertical) { //checking for land_noreturn to avoid unwanted climb out + if (((wp_distance < 2.0f * math::max(15.0f, flare_relative_alt)) && (_global_pos.alt < _global_triplet.current.altitude + flare_relative_alt)) || land_noreturn_vertical) { //checking for land_noreturn to avoid unwanted climb out /* land with minimal speed */ @@ -830,9 +830,9 @@ FixedwingPositionControl::control_position(const math::Vector2f ¤t_positio /* kill the throttle if param requests it */ throttle_max = _parameters.throttle_max; - if (_global_pos.alt < _global_triplet.current.altitude + motor_lim_relative_alt) { + // if ((_global_pos.alt < _global_triplet.current.altitude + motor_lim_relative_alt)) { throttle_max = math::min(throttle_max, _parameters.throttle_land_max); - } + // } float flare_curve_alt = _global_triplet.current.altitude + H0 * expf(-math::max(0.0f, flare_length - wp_distance)/flare_constant) - H1; @@ -897,7 +897,7 @@ FixedwingPositionControl::control_position(const math::Vector2f ¤t_positio _att_sp.yaw_body = _l1_control.nav_bearing(); /* apply minimum pitch and limit roll if target altitude is not within 10 meters */ - if (altitude_error > 10.0f) { + if (altitude_error > 15.0f) { /* enforce a minimum of 10 degrees pitch up on takeoff, or take parameter */ _tecs.update_pitch_throttle(_R_nb, _att.pitch, _global_pos.alt, _global_triplet.current.altitude, calculate_target_airspeed(_parameters.airspeed_min), |