Development Environment on Linux
Linux allows you to build for all PX4 targets (NuttX based hardware, Qualcomm Snapdragon Flight hardware, Linux-based hardware, Simulation, ROS).
We have standardized on Debian / Ubuntu Linux LTS (16.04) as the supported Linux distribution. Instructions are also provided for CentOS and Arch Linux.
The following instructions explain how to set up a development environment on Ubuntu LTS using convenience bash scripts. Instructions for manually installing these and additional targets can be found in Ubuntu/Debian Linux.
Development Toolchain
The instructions below show how you can use our convenience bash scripts to setup the developer toolchain on Ubuntu LTS. All the scripts install the Qt Creator IDE, Ninja Build System, Common Dependencies, FastRTPS, and also download the PX4 source to your computer (~/src/Firmware).
The scripts have been tested on a clean Ubuntu LTS 16.04 installation. They may not work as expected if installed on top of an existing system or on another Ubuntu release. If you have any problems then follow the manual installation instructions.
First make the user a member of the group "dialout"
- On the command prompt enter:
sudo usermod -a -G dialout $USER
- Logout and login again (the change is only made after a new login).
Then follow the instructions for your development target in the sections below.
Pixhawk/NuttX (and jMAVSim)
To install the development toolchain:
- Download ubuntu_sim_nuttx.sh.
- Run the script in a bash shell:
You may need to acknowledge some prompts as the script progresses.source ubuntu_sim_nuttx.sh
- Restart the computer on completion.
Snapdragon Flight
Setup instructions for Snapdragon Flight are provided in the PX4 User Guide:
Raspberry Pi
To install the development toolchain:
- Download ubuntu_sim_common_deps.sh (this contains the jMAVSim simulator and common toolchain dependencies).
- Run the script in a bash shell:
You may need to acknowledge some prompts as the script progresses.source ubuntu_sim_common_deps.sh
- Follow setup instructions in Ubuntu/Debian Linux for Raspberry Pi.
Parrot Bepop
Follow the (manual) instructions here: Ubuntu/Debian Linux > Parrot Bebop.
jMAVSim/Gazebo Simulation
To install the Gazebo and jMAVSim simulators:
- Download ubuntu_sim.sh.
- Run the script in a bash shell:
You may need to acknowledge some prompts as the script progresses.source ubuntu_sim.sh
If you just need jMAVSim, instead download and run ubuntu_sim_common_deps.sh.
PX4 works with Gazebo 7, 8, and 9. The script installs Gazebo 9.
Gazebo with ROS
To install the development toolchain:
- Download ubuntu_sim_ros_gazebo.sh.
- Run the script in a bash shell:
You may need to acknowledge some prompts as the script progresses.source ubuntu_sim_ros_gazebo.sh
Note:
- ROS is installed with Gazebo7 by default (we have chosen to use the default rather than Gazebo8 or Gazebo9 to simplify ROS development).
- Your catkin (ROS build system) workspace is created at ~/catkin_ws/.
Ground Control Software
Download and install the QGroundControl Daily Build.
Editor / IDE
The development team often use:
- Visual Studio Code: quite new, popular open source IDE
- Eclipse for C/C++: very feature rich Java based IDE
- Sublime Text: a fast and lean text editor.
- Qt Creator: A popular open-source IDE.
On linux the installation scripts automatically install Qt Creator as part of the common dependencies. You can launch it by entering
qtcreator
in a bash terminal.
Next Steps
Once you have finished setting up the environment, continue to the build instructions.