From 8296d02b1e4d2a546a9a802f73fd157ea4df4b1f Mon Sep 17 00:00:00 2001 From: Jaeyoung Lim Date: Tue, 28 Mar 2023 18:48:21 +0200 Subject: [PATCH] Eliminate intermediate variable --- .../fw_path_navigation/FixedwingPositionControl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/fw_path_navigation/FixedwingPositionControl.cpp b/src/modules/fw_path_navigation/FixedwingPositionControl.cpp index 71adfcbed8..9cc64b7f08 100644 --- a/src/modules/fw_path_navigation/FixedwingPositionControl.cpp +++ b/src/modules/fw_path_navigation/FixedwingPositionControl.cpp @@ -1308,8 +1308,6 @@ FixedwingPositionControl::control_auto_path(const float control_interval, const } // waypoint is a plain navigation waypoint - float position_sp_alt = pos_sp_curr.alt; - float target_airspeed = adapt_airspeed_setpoint(control_interval, pos_sp_curr.cruising_speed, _param_fw_airspd_min.get(), ground_speed); @@ -1331,16 +1329,14 @@ FixedwingPositionControl::control_auto_path(const float control_interval, const _att_sp.yaw_body = _yaw; // yaw is not controlled, so set setpoint to current yaw tecs_update_pitch_throttle(control_interval, - position_sp_alt, + pos_sp_curr.alt, target_airspeed, radians(_param_fw_p_lim_min.get()), radians(_param_fw_p_lim_max.get()), tecs_fw_thr_min, tecs_fw_thr_max, _param_sinkrate_target.get(), - _param_climbrate_target.get(), - false, - pos_sp_curr.vz); + _param_climbrate_target.get()); } void