diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index ac6f055917..1e44d77137 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -1478,20 +1478,21 @@ FixedwingPositionControl::control_landing(const Vector2f &curr_pos, const Vector if (!_land_noreturn_vertical) { // just started with the flaring phase - _att_sp.pitch_body = 0.0f; + _flare_pitch_sp = 0.0f; _flare_height = _global_pos.alt - terrain_alt; mavlink_log_info(&_mavlink_log_pub, "Landing, flaring"); _land_noreturn_vertical = true; } else { if (_global_pos.vel_d > 0.1f) { - _att_sp.pitch_body = radians(_parameters.land_flare_pitch_min_deg) * - constrain((_flare_height - (_global_pos.alt - terrain_alt)) / _flare_height, 0.0f, 1.0f); + _flare_pitch_sp = radians(_parameters.land_flare_pitch_min_deg) * + constrain((_flare_height - (_global_pos.alt - terrain_alt)) / _flare_height, 0.0f, 1.0f); } - // otherwise continue using previous _att_sp.pitch_body + // otherwise continue using previous _flare_pitch_sp } + _att_sp.pitch_body = _flare_pitch_sp; _flare_curve_alt_rel_last = flare_curve_alt_rel; } else { diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp index 898eebad7b..264a7ee209 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp @@ -211,6 +211,7 @@ private: hrt_abstime _time_last_t_alt{0}; ///< time at which we had last valid terrain alt */ float _flare_height{0.0f}; ///< estimated height to ground at which flare started */ + float _flare_pitch_sp{0.0f}; ///< Current forced (i.e. not determined using TECS) flare pitch setpoint */ float _flare_curve_alt_rel_last{0.0f}; float _target_bearing{0.0f}; ///< estimated height to ground at which flare started */