Browse Source

vtol_att update poll fd before poll call

sbg
Daniel Agar 7 years ago committed by Lorenz Meier
parent
commit
3b0b5645e1
  1. 26
      src/modules/vtol_att_control/vtol_att_control_main.cpp

26
src/modules/vtol_att_control/vtol_att_control_main.cpp

@ -596,6 +596,19 @@ void VtolAttitudeControl::task_main() @@ -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() @@ -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();

Loading…
Cancel
Save