making sure the mavlink fd is open in fw pos ctrl

This commit is contained in:
Thomas Gubler
2013-11-26 15:38:53 +01:00
parent d294953be7
commit b66730b5a9
@@ -1173,6 +1173,11 @@ FixedwingPositionControl::task_main()
/* only run controller if position changed */
if (fds[1].revents & POLLIN) {
/* XXX Hack to get mavlink output going */
if (mavlink_fd < 0) {
/* try to open the mavlink log device every once in a while */
mavlink_fd = open(MAVLINK_LOG_DEVICE, 0);
}
static uint64_t last_run = 0;
float deltaT = (hrt_absolute_time() - last_run) / 1000000.0f;