From 1b2973f6028b9868ee3e003ad3088f79661f38fb Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 15 Feb 2017 16:44:45 -0500 Subject: [PATCH] VTOL fw_att don't reset integrators during transition --- src/modules/fw_att_control/fw_att_control_main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index eba48450e4..1df1db2975 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -1032,8 +1032,12 @@ FixedwingAttitudeControl::task_main() _wheel_ctrl.reset_integrator(); } - /* If the aircraft is on ground reset the integrators */ - if (_vehicle_land_detected.landed || _vehicle_status.is_rotary_wing) { + /* Reset integrators if the aircraft is on ground + * or a multicopter (but not transitioning VTOL) + */ + if (_vehicle_land_detected.landed + || (_vehicle_status.is_rotary_wing && !_vehicle_status.in_transition_mode)) { + _roll_ctrl.reset_integrator(); _pitch_ctrl.reset_integrator(); _yaw_ctrl.reset_integrator();