Curious about the new features in the PX4 X-Plane Plugin v2.0.0? Check out this demo video where I walk you through the simplified setup process, showcase the multi-airframe support, and test various drones like the Ehang 184, Alia 250, Cessna 172, and Bayraktar TB2. Whether you're a student, researcher, or industry professional, this quick overview will get you up and running in no time!
👉 Watch the full demo and installation guide here!
- Download and Install Softwares
- Setting Up the Environment
- Clone and Build PX4
- Configuration
- Defining Custom Airframes
- Additional Tips
-
X-Plane Download X-Plane 11 or 12 from the X-Plane Official Website.
-
eVTOL Air Taxi (eHang 184) You can download the eVTOL Air Taxi (eHang 184) from the X-Plane Forum, though it's no longer required as the script supports multiple default airframes already available in X-Plane.
-
QGroundControl Download QGroundControl from the Official Download Page.
-
PX4xplane Plugin Download the precompiled binary from PX4xplane Releases. Install the plugin in the
Resources/Plugins
folder in X-Plane.
WSL2 (Windows Subsystem for Linux) allows you to run a Linux environment directly in Windows. This setup is necessary for Windows users to run PX4 simulation.
-
Ensure virtualization is enabled in your BIOS (Virtualization Technology, Intel VT-x, AMD-V).
-
For Windows 10 (build 19041 or higher) and Windows 11, open Command Prompt as administrator and install WSL2 with Ubuntu 22.04:
wsl --install
-
Once you have set up WSL2 and completed the initial PX4 installation with the provided script, you can use the
px4xplane
command to build and run the simulation from anywhere in your Linux terminal.
Note: The script is optimized for WSL but works on Linux too.
To quickly set up PX4 with X-Plane using WSL (Ubuntu 22.04), follow this simple step:
-
Run the setup script directly from your terminal:
First, make sure you are in your WSL Ubuntu terminal (launch it from PowerShell), then enter the following command in your WSL terminal:
cd ~ && curl -O https://raw.githubusercontent.com/alireza787b/px4xplane/master/setup/setup_px4_sitl.sh && bash setup_px4_sitl.sh
- Time Required: The installation process may take some time, depending on your system and configuration, especially the first time.
- Prompts: During installation, you will encounter several prompts asking you to customize the setup. You can either read and decide on each prompt or just let the defaults take effect (the script will automatically proceed with default settings if you don't respond).
- Once setup is complete, use the
px4xplane
command to run the simulation from anywhere in your terminal.
Advanced users can manually clone and set up the environment using the forked PX4 repository:
git clone https://github.com/alireza787b/PX4-Autopilot-Me.git --recursive
Navigate to the cloned directory:
cd PX4-Autopilot-Me
Run the setup script:
bash ./Tools/setup/ubuntu.sh
Configure PX4 SITL:
- In Windows Terminal, check your IP address (e.g.,
172.21.144.1
):ipconfig
- In the WSL Terminal, inside the PX4-Autopilot directory, set the PX4 simulation hostname with your IP:
export PX4_SIM_HOSTNAME=172.21.144.1
Follow the regular PX4 WSL setup instructions, replacing the official repository with the forked one. Once set up, you can build the desired airframes with commands like:
make px4_sitl xplane_ehang184
Other airframes include:
xplane_alia250
xplane_cessna172
xplane_tb2
Automatic Configuration: The automated script handles all configuration steps, including setting up the airframes for X-Plane. You only need to select the desired airframe during the setup process.
Start the simulation:
px4xplane
The selected airframe will automatically load in X-Plane, and you can manage the configuration through the PX4 SITL menus directly. Manual parameter loading is no longer required for the supported airframes.
If you need to define new airframes for your simulation, follow the detailed guide here:
👉 How to Define Custom Airframes in PX4-XPlane
This guide will walk you through the process of setting up custom configurations, mapping PX4 channels to X-Plane datarefs, and integrating new airframes into your simulations. Whether you're using existing X-Plane models or creating new ones in Plane Maker, this guide has you covered.
- Maintain a high FPS in X-Plane for stable flight.
- The EKF estimator may have limitations in high acceleration maneuvers.
- For errors: use the script's repair mode:
./setup_px4_sitl.sh --repair
. - If issues persist, you may need to delete the cloned repository and start from scratch.
- You can remove the global paths using the uninstall option:
px4xplane --uninstall
. - Remember, you can always manually build by navigating to your cloned repository and running the build commands directly.
- YouTube video demonstration will be released soon.
- For more information, visit the Official GitHub Repository.