Hi! I am a newbie to MissionPlanner, ArduPilot/SITL, and X-Plane, and I am trying to get my feet wet with SITL by getting any ordinary Plane to fly using MP. I’m using MP 1.3.68, ArduPilot 3.9 and X-Plane 11.36 on my Windows 10 PC. MP and X-Plane run natively on Windows 10, but I build ArduPilot/SITL under WSL/Ubuntu 16.04 LTS, and start it separately (not thru MP). I have watched with envy several wonderful videos of people using MP<>SITL<>X-Plane to fly different aircraft (747-400 even), but I can not get anything to happen even with a Cessna 172SP.
Here is some info based on printf’s that I have inserted in the SITL code: X-Plane is able to exchange UDP packets with SITL, and it also looks like MP has established communication with SITL using TCP port 5760. I have a trivial mission setup with a few way points, and when I load it in Auto mode, nothing happens to the Cessna 172SP that I have sitting on the runway. Actually, SITL starts exchanging packets with X-Plane only after it makes the connection with MP! There is an error message on the HUD in MP about how WA MINTWA, MAXTWA and DEPTWA must be ‘p’, and I have tried to set them in the params screen, but it made no difference. Here are some screenshots:
I have not explicitly loaded any params in SITL or MP, because I got the impression that the default params would be enough to get started. I’d greatly appreciate any insights or inputs to help me solve this problem, so I can move on to real work with using MP<>SITL to control a tilt-rotor VTOL aircraft our company is building. Thanks a lot in advance!
Laminar Research might have changed something on their end. There are a lot of changes happening with x-plane all the time so 11.36 might not have the correct UDP output for SITL to understand. In 11.32r2 I had to use “legacy” UDP settings. Can you downgrade x-plane? It honestly sucks to keep up with the wild changes it makes to everything.
@TunaLobster Thank you for your quick response. I see what you are saying about numerous changes in X-Plane, but fortunately, I have verified that the SITL<>X-Plane UDP exchange works fine. The problem is that the mission sent to SITL by MissionPlanner in AUTO mode does not seem to be passed on to X-Plane, to affect the aircraft’s behavior. To begin with, my plane does not even move, let alone takeoff!
By mission begin “passed on to X-Plane”, I meant some mapping of the high level mission steps into more primitive steps for X-Plane to carry out, like setting the throttle level to full for takeoff, etc.
Double checking here. Have you mapped controls on your aircraft? They should be there by default.
I had it setup so that in X-Plane Network tab receive was 49000 and send was on 49002. Then on the Data output tab I put in 127.0.0.1 (localhost) and port 49001. That should get the data flowing back and forth between ArduPlane and X-Plane.
After that you need to check out MavProxy commands to get the vehicle armed, set mode to manual, and fly the plane in X-Plane. I don’t really trust auto TO/L in X-Plane SITL because of the altitude model differences. It shouldn’t be having issues, but it does and I gave up on tracking down the issue. Maybe other simulators work with ArduPlane on the altitude, but I haven’t had a chance to deep dive.
Oh! And for most of the engines in X-Plane you have to start them manually (Crtl+Shift+E?). There is probably some switch somewhere in Plane Maker to have the engines always run at idle.
@TunaLobster I haven’t touched my original joystick mappings; i.e., I can still fly the plane manually in X-Plane, even though I have X-Plane exchanging UDP packets with SITL. I even see the altitude and heading and stuff change in MP - I wasn’t even looking for that before! As for starting engines manually, I actually do that from SITL (by adding a trivial bit of code to SIM_XPlane.cpp) once SITL starts receiving valid packets from X-Plane - I was just playing with it just to verify that SITL is able to send stuff to X-Plane! There is, indeed, a checkbox in X-Plane when you select an aircraft to fly, whether you want the engines started automatically after load. Anyhow, if I have to fly the plane manually in X-Plane, I don’t understand the role of SITL and MissionPlanner! It should be obvious that I have huge huge in my understanding of the partitioning of functionality between X-Plane and SITL. Anyhow, you are suggesting that it would be better for me to use MAVProxy; I’ll have to install and learn to use it. Thanks a lot for your input.
Can you not set FBWA or FBWB mode in MP and have the plane stabilize? The data could be sent, but ArduPlane might not be armed. MAVProxy give you another command line to change RC channels and see more data. You could also try hitting the arm/disarm button in MP. I don’t have my internal document to reference right now. I can post some more details on how I get MAVProxy/MP up and running tomorrow.
Hi! I have had some success since my last post. As you suggested, I loaded the Cessna and started the engines and released the brake, and then in MP, still in AUTO mode, hit the Arm/Disarm button from “Actions”. MP complains, but allows me to force the arming, the Cessna gets full throttle, and starts to takeoff! Hurray!!! I think my params to MP must be really sucky, because it flies quite wildly. It seems to apply way too much correction for pitch, yaw and roll, and so it seems like it is drunk while it meanders towards the first Waypoint! At least, I now know that the plumbing from MP to X-Plane and back works. At the rate it was going, it would have taken an hour to get to the first WP, so I decided to hit the RTL button, and the drunken Cessna definitely turned 180 degrees and came back to land and crashed!! I could try to execute the mission in FBWA/FBWB, but does it require a bunch of other parameter settings? I’d prefer sticking with MP, and not have to deal with MAXProxy, but even the ArduPilot doc says they recommend MAVProxy for the total control it is supposed to give. By the way, I tried to enable the Joystick to be handled by MP rather than by X-Plane, but I felt that there was too much lag and the response of the plane to joystick manipulations was awful. Of course, I am building ArduPilot/SITL with the --debug flag, and that it probably the biggest performance killer.