With X-Plane running with a plane on a runway (or anywhere really), go ahead and run monitorExample.py! I will be using Visual Studio Code to program this XPlane Python autopilot stuff so that’s where I’ll run it from. For me, I just downloaded the entire git structure so the code is at C:\Users\Austin\source\repos\XPlaneConnect\Python3\src: Screenshot showing xpc.py and monitorExample.py in my working directory 5 – Run sample code to verify data is making it from X-Plane to our code You should see X-Plane Connect checked in the enabled column: Screenshot showing XPlaneConnect plug-in active in X-Plane 11 Screenshot showing XPlaneConnect plug-in active in X-Plane 10 4 – Download sample code from XPlaneConnect’s GitHub pageįrom the Python3 portion of the GitHub code, download xpc.py and monitorExample.py and stick them in your working directory (doesn’t matter where). ![]() Go to the top menu and select Plugins -> Plugin Admin. Now we’ll load up X-Plane and check the plug-ins to verify XPlaneConnect is enabled. Screenshot of X-Plane 10 plugins directory with XPlaneConnect folder added Screenshot of X-Plane 11 plugins directory with XPlaneConnect folder added 3 – Verify XPlaneConnect is active in X-Plane Mine looked like this after adding the XPlaneConnect folder: There are few other folders already present in this directory. zip and place the contents in the /Resources/plugins folder. Download the latest version from the XPlaneConnect GitHub releases page, 1.3 RC6 as of writing.They have adapters for C, C++, Java, Matlab, and Python. NASA (yes, that NASA, the National Aeronautics and Space Administration) has wrote a bunch of code to interface with X-Plane. 2 – Download and install NASA’s XPlaneConnect plug-in My screenshots might jump between the two versions but the content/message will be the same. I just tested and the plug-in/code works fine on X-Plane 11 (but the flight models are definitely different and will need different PID values). X-Plane 11 is available on Steam for $59.99 as of writing. X-Plane 10 is hard to find these days I just discovered. Run the sample script to verify data is being transmitted from X-Plane via UDP to the XPlaneConnect codeġ – Download and install X-Plane 10 or X-Plane 11.Download sample code from XPlaneConnect’s GitHub page.Verify the XPlaneConnect plug-in is active in X-Plane.Download and install NASA’s XPlaneConnect X-Plane plug-in to X-Plane.Download and install X-Plane (I used X-Plane 10 because it uses less resources than X-Plane 11 and we don’t need the graphics/scenery to look super pretty to do coding.Video can’t be loaded because JavaScript is disabled: Coding an Autopilot in X-Plane Using Python – Part 1 () Contents The real programming will start with the next post. ![]() This post will get X-Plane hooked up to Python. I thought – “hmm how hard could this be to duplicate in a flight sim?”. I drive a little plane or car in the game to get around my base and I just added a plug-in that “snaps” the vehicle to a heading, which makes it easier to go in straight lines. I got started thinking about writing some code for X-Plane while playing another game, Factorio. More than one FAA-certified simulator setups are running X-Plane as the primary driver software. It is regarded as having one of the best flight models and has tons of options for getting data into/out of the simulator. X-Plane is a well-known flight simulator developed by another Austin – Austin Meyer. I’ve been a fan of flight simulators for quite some time (I distinctly remember getting Microsoft Flight Simulator 98 for my birthday when I was like 8 or 9) but have only recently started working with interfacing them to code. ![]() Today’s post will be about hooking up some Python code to the X-Plane flight simulator to enable development of an autopilot using PID (proportional-integral-derivative) controllers. Today’s post will take us in a slightly different direction than the last few.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |