Windows Installation Instructions
There are a number of ways you can set up a Windows development toolchain for PX4. These allow you to build for NuttX/Pixhawk and jMAVSim simulator targets.
The Windows toolchains are not officially supported (and we discourage their use). They are unbearably slow during Firmware compilation and do not support new boards like Snapdragon Flight. They also cannot run the standard robotics software packages many developers use to prototype computer vision and navigation.
Before starting to develop on Windows, consider installing a dual-boot environment with Ubuntu.
Download and install these on your system:
- PX4 Toolchain Installer v14 for Windows Download (32/64 bit systems, complete build system, drivers)
- PX4 USB Drivers (32/64 bit systems)
Bash on Windows (NEW!)
Windows users can alternatively install a slightly modified Ubuntu Linux PX4 development environment within Bash on Windows, and use it to:
- Build firmware for NuttX/Pixhawk targets.
- Run the PX4 JMAVSim simulation (using a Windows-hosted X-Windows app to display the UI)
To setup the development environment:
- Install Bash on Windows.
- Open the bash shell.
- Download the windows_bash_nuttx.sh:
- Run the script using the command below (acknowledging any prompts as required):
To build the firmware (i.e. for px4fmu-v4):
Enter the following commands in the bash shell:
cd ~/src/Firmware make px4fmu-v4_default
On successful completion you'll find the firmware here:
makecommands to build firmware for other boards can be found in Building the Code
You can flash the custom firmware on Windows using QGroundControl or Mission Planner (it is not possible to directly flash the firmware from within the bash shell using the
Bash on Windows does not include support for UI libraries. In order to display the jMAVSim UI you will first need to install an X-Window application like XMing into Windows.
To run JMAVSim:
- Install and start XMing on Windows.
- Enter the following command in the bash shell:
Add this line to the Ubuntu .bashrc file if you don't want to enter it every session.
Start PX4 and jMAVSim in the bash shell:
make posix jmavsim
The JMAVSim UI is then displayed in XMing as shown below:
Gazebo can similarly be run within Ubuntu Bash for Windows, but too slow to be useful. To try this, follow the ROS kinetic install guide and run Gazebo in the Bash shell as shown:
export DISPLAY=:0 export GAZEBO_IP=127.0.0.1 make posix gazebo
Build Script Details
The windows_bash_nuttx.sh build script modifies the Ubuntu build instructions to remove Ubuntu-specific and UI-dependent components, including the Qt Creator IDE and the simulators.
In addition, it uses a 64 bit arm-none-eabi compiler
since BashOnWindows doesn't run 32 bit ELF programs (and the default compiler from
https://launchpad.net/gcc-arm-embedded is 32 bit).
To add this compiler to your environment manually:
- Download the compiler:
- Unpack it using this command line in the Bash On Windows console:
This will unpack the arm gcc cross-compiler to:
tar -xvf gcc-arm-none-eabi-5_4-2017q2-20170512-linux.tar.bz2
- Add the to the environment (add the line to your bash profile to make the change permanent)
Virtual Machine-Hosted Toolchain
Windows developers can also run the PX4 toolchain in a virtual machine. The installation and setup of PX4 within the VM is exactly the same as on a native Linux computer.
Allocate as many CPU and memory resources to the VM as possible.
While using a VM is a very easy way to set up and test an environment for building firmware, users should be aware:
- Firmware building will be slower than native building on Linux.
- The JMAVSim frame rate be much slower than on native Linux. In some cases the vehicle may crash due to issues related to insufficient VM resources.
- Gazebo and ROS can be installed, but are unusably slow.
Ground Control Software
Download and install the QGroundControl Daily Build.
Editor / IDE
The development team often use:
Once you have finished setting up the environment, continue to the build instructions.