From 3ef5f433b51f0ce1cdd3e6adfc47bb2d8cf891a4 Mon Sep 17 00:00:00 2001 From: Thomas Stastny Date: Fri, 6 May 2022 11:02:40 +0200 Subject: [PATCH] fw pos ctrl: add missing guidance control interval setting to control_manual_position() --- .../fw_pos_control_l1/FixedwingPositionControl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 1c3d4355af..b362d8682c 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -2122,6 +2122,14 @@ FixedwingPositionControl::control_manual_position(const hrt_abstime &now, const { const float dt = update_position_control_mode_timestep(now); + // update lateral guidance timesteps for slewrates + if (_param_fw_use_npfg.get()) { + _npfg.setDt(dt); + + } else { + _l1_control.set_dt(dt); + } + // if we assume that user is taking off then help by demanding altitude setpoint well above ground // and set limit to pitch angle to prevent steering into ground // this will only affect planes and not VTOL