vtol_att_control_main: only reset thrust when disarmed

to see flaps moving according to attitude control before arming
and not have tailsitter elevons move to follow north heading.
This commit is contained in:
Matthias Grob
2019-10-16 16:30:38 +02:00
parent 4cc7b1319f
commit a053b7f69b
@@ -48,7 +48,6 @@
*/
#include "vtol_att_control_main.h"
#include <systemlib/mavlink_log.h>
#include <matrix/matrix/math.hpp>
#include <uORB/PublicationQueued.hpp>
using namespace matrix;
@@ -393,9 +392,7 @@ VtolAttitudeControl::Run()
// 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);
}
@@ -414,9 +411,7 @@ VtolAttitudeControl::Run()
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);
}
}