mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 15:38:53 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user