I have quite bit of experience writing plugins for X-Plane going back a number of years, but ArduPilot is new to me.
So, I am trying to get ArduPlane working with X-Plane 11 as SITL, and I’ve made some progress. X-Plane 11/ArduPlane are successfully sending data to Mission Planner, and as I fly around (under manual control in X-Plane), I can see the plane’s progress on Mission Planner’s moving map and artificial horizon. Exciting
However, I cannot get the data flowing the other way, i.e. I can’t get ArduPlane to send data to X-Plane.
I’ve been looking at the codebase (having set up a working toolchain) and I’m trying to figure out where things are going wrong. All softwares are latest versions as of today, and everything’s running on the same Windows 10 machine, that is: X-Plane 11, ArduPlane running under WSL, and Mission Planner. Here is my process:
- In WSL, I run ArduPlane using
build/sitl/bin/arduplane --base-port 5760 -r 50 -M xplane --irlock-port 9005. Note that I do not try to set the --sim-port-in or --sim-port-out options, as they appear to be hardcoded as 49001 and 49000 respectively in ardupilot/libraries/SITL/SIM_XPlane.h.
- I run X-Plane 11.
- I run Mission Planner.
Here are some notes on how I have X-Plane 11 configured:
On the Data Output page in Settings:
- UDP Rate: 50 packets/sec
- General Data Output tab:
– IP Address: 127.0.0.1 <-- I’m running X-Plane 11, Mission Planner and ArduPlane (SITL) on the same PC.
– Port: 49001 (default 49000) <-- I have found that specifying port 49001 is ESSENTIAL for Mission Planner to be able to read in data from X-Plane.
– Data to Output: <-- This should be configured by ArduPlane automatically, but I can’t get that to work. Thus, I check these boxes manually:
1 - Times
3 - Speeds
4 - Mach, VVI, g-load
8 - Joystick aileron/joystick/rudder
13 - Trim, flap, stats, & speedbrakes
16 - Angular velocities
17 - Pitch, roll, & headings
20 - Latitude, longitude, & altitude
21 - Location, velocity, & distance traveled (sic)
25 - Throttle (commanded)
29 - Mixture setting
37 - Engine RPM
38 - Propeller RPM
39 - Propeller pitch
58 - Generator on/off
- Dataref read/write tab: <-- Irrelevant because ArduPlane uses UDP to send data to X-Plane, rather than Datarefs. Btw, UDP access to X-Plane has a problematic history.
On the Network page in Settings:
- UDP PORTS:
– Port we receive on: 49000 (default 49010) <-- One would expect 49000 to work, given that it’s specified in ardupilot/libraries/SITL/SIM_XPlane.h.
– Port we receive on (legacy): 49000 (default 49000) <-- ???
– Port we send from (legacy): 49001 (default 49001) <-- ???
Once everything is up and running, I make a few waypoints and select ‘Write WPs’. Then, when I try to ‘Arm’, I am given a failure message, whereupon I choose ‘Force Arm’. The aircraft status is now ‘Armed’. Next, I select ‘Auto’, but nothing happens. X-Plane is not receiving any data, so steering commands from ArduPlane aren’t honoured. My question is why?
I’d appreciate any help