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).

Ubuntu Linux LTS 16.04 is the tested/supported Linux distribution for most development. Ubuntu 18.04 LTS with ROS Melodic is used for ROS development. 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 clean Ubuntu LTS 16.04 and Ubuntu LTS 18.04 installations. 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":

  1. On the command prompt enter:
    sudo usermod -a -G dialout $USER
    
  2. 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:

  1. Download ubuntu_sim_nuttx.sh.
  2. Run the script in a bash shell:
    source ubuntu_sim_nuttx.sh
    
    You may need to acknowledge some prompts as the script progresses.
  3. 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:

  1. Download ubuntu_sim_common_deps.sh (this contains the jMAVSim simulator and common toolchain dependencies).
  2. Run the script in a bash shell:
    source ubuntu_sim_common_deps.sh
    
    You may need to acknowledge some prompts as the script progresses.
  3. 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 Gazebo9 and jMAVSim simulators:

  1. Download ubuntu_sim.sh.
  2. Run the script in a bash shell:
    source ubuntu_sim.sh
    
    You may need to acknowledge some prompts as the script progresses.

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 Melodic

PX4 is tested with ROS Melodic on Ubuntu 18.04 LTS. ROS Melodic does not work on Ubuntu 16.04.

To install the development toolchain:

  1. Download ubuntu_sim_ros_melodic.sh.
  2. Run the script in a bash shell:
    source ubuntu_sim_ros_melodic.sh
    
    You may need to acknowledge some prompts as the script progresses.

Note:

  • ROS Melodic is installed with Gazebo9 by default.
  • Your catkin (ROS build system) workspace is created at ~/catkin_ws/.

Additional Tools

After setting up the build/simulation toolchain, see Additional Tools for information about other useful tools.

Next Steps

Once you have finished setting up the environment, continue to the build instructions.

results matching ""

    No results matching ""