From 07d72f8604a37201b1d8b4febf14a785d4299f85 Mon Sep 17 00:00:00 2001 From: Jaeyoung-Lim Date: Mon, 11 Oct 2021 19:55:53 +0200 Subject: [PATCH] Fix comments --- .../fw_pos_control_l1/FixedwingPositionControl.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 087277aae7..1463143d1d 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -1689,8 +1689,6 @@ FixedwingPositionControl::control_altitude(const hrt_abstime &now, const Vector2 _att_sp.thrust_body[0] = min(get_tecs_thrust(), throttle_max); } - // decide when to use pitch setpoint from TECS because in some cases pitch - // setpoint is generated by other means _att_sp.pitch_body = get_tecs_pitch(); _last_manual = !_control_mode.flag_control_position_enabled; @@ -1811,8 +1809,6 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2 _att_sp.thrust_body[0] = min(get_tecs_thrust(), throttle_max); } - // decide when to use pitch setpoint from TECS because in some cases pitch - // setpoint is generated by other means _att_sp.pitch_body = get_tecs_pitch(); _last_manual = !_control_mode.flag_control_position_enabled; @@ -1961,7 +1957,6 @@ FixedwingPositionControl::Run() Vector2f ground_speed(_local_pos.vx, _local_pos.vy); set_control_mode_current(_pos_sp_triplet.current.valid); - bool setpoint = true; switch (_control_mode_current) { case FW_POSCTRL_MODE_AUTO: { @@ -1981,7 +1976,6 @@ FixedwingPositionControl::Run() } case FW_POSCTRL_MODE_OTHER: { - setpoint = false; /* do not publish the setpoint */ // reset hold altitude _hold_alt = _current_altitude; @@ -1999,7 +1993,8 @@ FixedwingPositionControl::Run() } - if (setpoint) { + if (_control_mode_current != FW_POSCTRL_MODE_OTHER) { + if (_control_mode.flag_control_manual_enabled) { _att_sp.roll_body = constrain(_att_sp.roll_body, -radians(_param_fw_man_r_max.get()), radians(_param_fw_man_r_max.get()));