From 3b0b5645e14e36c1bc7025db81ebbb7d9d8d0007 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 1 Mar 2018 11:48:44 -0500 Subject: [PATCH] vtol_att update poll fd before poll call --- .../vtol_att_control_main.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 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 f0d734c6e7..1b3535cfff 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -596,6 +596,19 @@ void VtolAttitudeControl::task_main() parameters_update(); } + // run vtol_att on MC actuator publications, unless in full FW mode + switch (_vtol_type->get_mode()) { + case TRANSITION_TO_FW: + case TRANSITION_TO_MC: + case ROTARY_WING: + fds[0].fd = _actuator_inputs_mc; + break; + + case FIXED_WING: + fds[0].fd = _actuator_inputs_fw; + break; + } + /* wait for up to 100ms for data */ int pret = px4_poll(&fds[0], sizeof(fds) / sizeof(fds[0]), 100); @@ -612,19 +625,6 @@ void VtolAttitudeControl::task_main() continue; } - // run vtol_att on MC actuator publications, unless in full FW mode - switch (_vtol_type->get_mode()) { - case TRANSITION_TO_FW: - case TRANSITION_TO_MC: - case ROTARY_WING: - fds[0].fd = _actuator_inputs_mc; - break; - - case FIXED_WING: - fds[0].fd = _actuator_inputs_fw; - break; - } - vehicle_control_mode_poll(); vehicle_manual_poll(); vehicle_attitude_poll();