This page has moved to https://docs.px4.io/master/en/dev_setup/dev_env_mac.html.
Click here if you are not redirected.
MacOS is a supported development platform for PX4. The following instructions set up an environment for building:
- NuttX-based hardware (Pixhawk, etc.)
- jMAVSim Smulation
- Gazebo Simulation
To build other targets see: Toolchain Installation > Supported Targets.
A video tutorial can be found here: Setting up your PX4 development environment on macOS.
The installation of Homebrew is quick and easy: installation instructions.
The PX4 toolchain requires the usage of the ZSH shell. If you are using the shell, add this line to your shell profile:
Create this file or append it:
~/.zshenv and add this line:
ulimit -S -n 2048
If not already existing, create the file
~/.zshrc and add these lines:
# Point python to python 3 from Homebrew
# Point pip to python 3 pip
After installing Homebrew, run these commands in your shell to install the common tools:
brew tap PX4/px4
brew install px4-dev
Install the required Python packages
# install required packages using pip3
python3 -m pip install --user pyserial empy toml numpy pandas jinja2 pyyaml pyros-genmsg packaging
# if this fails with a permissions error, your Python install is in a system path - use this command instead:
sudo -H python3 -m pip install --user pyserial empy toml numpy pandas jinja2 pyyaml pyros-genmsg packaging
To install SITL simulation with Gazebo:
brew cask install xquartz
brew install px4-sim-gazebo
To use SITL simulation with jMAVSim you need to install a recent version of Java (e.g. Java 14). You can either download Java 14 from Oracle or use the AdoptOpenJDK tap:
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk14
brew install px4-sim-jmavsim
jMAVSim for PX4 v1.11 and earlier required Java 8.
See Additional Tools for information about other useful development tools that are not part of the build toolchain (for example IDEs and GCSs).
Once you have finished setting up the environment, continue to the build instructions.