mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 14:11:37 +08:00
vtol_att update poll fd before poll call
This commit is contained in:
committed by
Lorenz Meier
parent
1ef7b351be
commit
3b0b5645e1
@@ -596,6 +596,19 @@ void VtolAttitudeControl::task_main()
|
|||||||
parameters_update();
|
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 */
|
/* wait for up to 100ms for data */
|
||||||
int pret = px4_poll(&fds[0], sizeof(fds) / sizeof(fds[0]), 100);
|
int pret = px4_poll(&fds[0], sizeof(fds) / sizeof(fds[0]), 100);
|
||||||
|
|
||||||
@@ -612,19 +625,6 @@ void VtolAttitudeControl::task_main()
|
|||||||
continue;
|
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_control_mode_poll();
|
||||||
vehicle_manual_poll();
|
vehicle_manual_poll();
|
||||||
vehicle_attitude_poll();
|
vehicle_attitude_poll();
|
||||||
|
|||||||
Reference in New Issue
Block a user