From 700444a173e75c06aff7c37fa0259f7d52a06f7d Mon Sep 17 00:00:00 2001 From: Pandacoolcool <1308455330@qq.com> Date: Mon, 14 Oct 2019 17:22:56 +0800 Subject: [PATCH] vtol_att_control_main.cpp:remove reset before arm remove attitude setpoint reset before arm --- .../vtol_att_control_main.cpp | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) 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 3facf8f049f3..ba8c34a12043 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -390,15 +390,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) { - Quatf().copyTo(_mc_virtual_att_sp.q_d); - Vector3f().copyTo(_mc_virtual_att_sp.thrust_body); - Quatf().copyTo(_v_att_sp.q_d); - Vector3f().copyTo(_v_att_sp.thrust_body); - } - _vtol_type->update_transition_state(); _v_att_sp_pub.publish(_v_att_sp); } @@ -412,18 +403,10 @@ VtolAttitudeControl::Run() _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) { - Quatf().copyTo(_mc_virtual_att_sp.q_d); - Vector3f().copyTo(_mc_virtual_att_sp.thrust_body); - Quatf().copyTo(_v_att_sp.q_d); - Vector3f().copyTo(_v_att_sp.thrust_body); - } + _vtol_type->update_mc_state(); + _v_att_sp_pub.publish(_v_att_sp); } - _vtol_type->update_mc_state(); - _v_att_sp_pub.publish(_v_att_sp); - break; case mode::FIXED_WING: