From 871219d1996f831bf385b5b9d6a0c466fd74c5f2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Jul 2016 14:39:44 +1000 Subject: [PATCH] SITL: support helicopters with X-Plane 10 we get collective from "throttle2" and get interlock from generator1 on/off --- libraries/SITL/SIM_XPlane.cpp | 105 +++++++++++++++++++++++++--------- libraries/SITL/SIM_XPlane.h | 7 +++ 2 files changed, 85 insertions(+), 27 deletions(-) diff --git a/libraries/SITL/SIM_XPlane.cpp b/libraries/SITL/SIM_XPlane.cpp index c638f8168d..25db18664f 100644 --- a/libraries/SITL/SIM_XPlane.cpp +++ b/libraries/SITL/SIM_XPlane.cpp @@ -41,6 +41,9 @@ XPlane::XPlane(const char *home_str, const char *frame_str) : if (colon) { xplane_ip = colon+1; } + + heli_frame = (strstr(frame_str, "-heli") != nullptr); + socket_in.bind("0.0.0.0", bind_port); printf("Waiting for XPlane data on UDP port %u and sending to port %u\n", (unsigned)bind_port, (unsigned)xplane_port); @@ -98,9 +101,11 @@ bool XPlane::receive_data(void) uint8_t *p = &pkt[5]; const uint8_t pkt_len = 36; uint64_t data_mask = 0; - const uint64_t required_mask = (1U<