Browse Source

fw pos ctrl: fix glide slope calculation, from geometry, not param

main
Thomas Stastny 3 years ago committed by Daniel Agar
parent
commit
6612d4696d
  1. 3
      src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

3
src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp

@ -1788,7 +1788,8 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo @@ -1788,7 +1788,8 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo
/* longitudinal guidance */
// open the desired max sink rate to encompass the glide slope if within the aircraft's performance limits
const float glide_slope_sink_rate = airspeed_land * sinf(math::radians(_param_fw_lnd_ang.get()));
// x/sqrt(x^2+1) = sin(arctan(x))
const float glide_slope_sink_rate = airspeed_land * glide_slope / sqrtf(glide_slope * glide_slope + 1.0f);
const float desired_max_sinkrate = math::min(math::max(glide_slope_sink_rate, _param_sinkrate_target.get()),
_param_fw_t_sink_max.get());

Loading…
Cancel
Save