From 67f514e25087543a792c76eae616f0e1fb72f458 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 16 Oct 2019 16:29:14 +0200 Subject: [PATCH] att_control: remove resetting the attitude setpoint since the position controller publishes them again already when disarmed. --- .../mc_att_control/mc_att_control_main.cpp | 6 ------ .../vtol_att_control/vtol_att_control_main.cpp | 15 --------------- 2 files changed, 21 deletions(-) diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index c4e6c6dc9621..5ae89c85f07a 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -350,12 +350,6 @@ MulticopterAttitudeControl::control_attitude() { _v_att_sp_sub.update(&_v_att_sp); - // reinitialize the setpoint while not armed to make sure no value from the last mode or flight is still kept - if (!_v_control_mode.flag_armed) { - Quatf().copyTo(_v_att_sp.q_d); - Vector3f().copyTo(_v_att_sp.thrust_body); - } - // physical thrust axis is the negative of body z axis _thrust_sp = -_v_att_sp.thrust_body[2]; diff --git a/src/modules/vtol_att_control/vtol_att_control_main.cpp b/src/modules/vtol_att_control/vtol_att_control_main.cpp index 0478e1316841..42aa8d9a267e 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -389,13 +389,6 @@ VtolAttitudeControl::Run() _fw_virtual_att_sp_sub.update(&_fw_virtual_att_sp); if (mc_att_sp_updated || fw_att_sp_updated) { - - // reinitialize the setpoint while not armed to make sure no value from the last mode or flight is still kept - if (!_v_control_mode.flag_armed) { - Vector3f().copyTo(_mc_virtual_att_sp.thrust_body); - Vector3f().copyTo(_v_att_sp.thrust_body); - } - _vtol_type->update_transition_state(); _v_att_sp_pub.publish(_v_att_sp); } @@ -408,14 +401,6 @@ VtolAttitudeControl::Run() _vtol_vehicle_status.vtol_in_trans_mode = false; _vtol_vehicle_status.in_transition_to_fw = false; - if (mc_att_sp_updated) { - // reinitialize the setpoint while not armed to make sure no value from the last mode or flight is still kept - if (!_v_control_mode.flag_armed) { - Vector3f().copyTo(_mc_virtual_att_sp.thrust_body); - Vector3f().copyTo(_v_att_sp.thrust_body); - } - } - _vtol_type->update_mc_state(); _v_att_sp_pub.publish(_v_att_sp);