# PX4 with X-Plane and QGroundControl Setup Guide (v2.0.0, August 2024) ![YouTube Video Coming Soon](https://via.placeholder.com/900x500.png?text=YouTube+Video+Coming+Soon) Watch full setup guide and demonstration on YouTube: [PX4 X-Plane Plugin Tutorial](https://www.youtube.com/watch?v=aRJxsnf24k4). PX4 Setup Guide with X-Plane and QGroundControl ``` 5. **Additional Tips**: Helpful tips for troubleshooting and advanced options like repair and uninstall modes. 6. **Footer with Copyright Notice**: Links to the author’s LinkedIn and the project’s GitHub repository.

PX4 with X-Plane and QGroundControl Setup Guide (v1.0.0-beta, Nov 2023)

PX4 X-Plane Plugin Tutorial

Watch full setup guide and demonstration on YouTube: PX4 X-Plane Plugin Tutorial.

Download and Install Softwares

  1. X-Plane:

    Download X-Plane 11 or 12 from the X-Plane Official Website.

  2. Quadricopter eVTOL Air Taxi:

    Download the Quadricopter eVTOL Air Taxi from the X-Plane Forum. Install it in the Aircraft/ folder.

  3. QGroundControl:

    Download QGroundControl from the Official Download Page.

  4. PX4xplane Plugin:

    Download the precompiled binary from PX4xplane Releases.

    Copy the px4xplane folder to the specific drone's plugin folder in X-Plane: X-Plane Installation Folder/Aircraft/Quadricopter-Piloted/Plugins

    For global installation: X-Plane Installation Folder/Resources/Plugins

Setting Up the Environment

Note for Mac and Linux Users: No extra steps are required for setting up the environment on Mac and Linux systems.

Windows Users - Setting Up WSL2

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.

First, ensure virtualization (Virtualization Technology, Intel VT-x, AMD-V) is enabled in BIOS.

For Windows 10 (build 19041 or higher) and Windows 11, Open Command Prompt as administrator and install WSL2 with Ubuntu 22.04:

wsl --install

If you need more help or information about WSL, consider the following resources:

Hint: If you want a different version of Ubuntu or need to manage multiple WSL instances, you can specify the distribution during installation using commands like wsl --install -d Ubuntu-20.04.

Clone and Build PX4

Hint: Some steps might change over time. Make sure to check latest instruction from PX4 Official Documentation.

In WSL2, clone and set up the PX4 environment:

git clone https://github.com/PX4/PX4-Autopilot.git --recursive

Navigate to the cloned directory:

cd PX4-Autopilot

Run the setup script:

bash ./Tools/setup/ubuntu.sh

Restart System:

If using WSL:

exit
wsl --shutdown
wsl

Run X-Plane and Load Drone

Start X-Plane and load the Quadricopter eVTOL Air Taxi.

Configure PX4 SITL

In Windows Terminal, check your IP address:(eg. 172.21.144.1)

ipconfig

In the WSL Terminal and inside the PX4-Autopilot, Set the PX4 simulation hostname with your IP:

export PX4_SIM_HOSTNAME=172.21.144.1

Start the simulation:

make px4_sitl none_iris

Configuration

Set Up QGroundControl

For direct connection on Mac/Linux, QGroundControl should auto-connect.

For remote connection (e.g., WSL2):

Connect X-Plane to PX4 SITL

In X-Plane, go to the plugin menu and connect to SITL by following these steps:

Load Parameters in QGroundControl

To load parameters:

Joystick Calibration

Calibrate your joystick as needed in X-Plane or QGroundControl.

Additional Tips