Skip to content

Commit

Permalink
vtol_att update poll fd before poll call
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar authored and LorenzMeier committed Mar 1, 2018
1 parent 1ef7b35 commit 3b0b564
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/modules/vtol_att_control/vtol_att_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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();
Expand Down

0 comments on commit 3b0b564

Please sign in to comment.