Skip to main content

6.6 PX4

You need to install the PX4 development toolchain to use the emulator.

The only dependency ROS 2 has on PX4 is the set of message definitions, which it gets from px4_msgs. You only need to install PX4 if you need a simulator (as we do in this guide) or if you are creating a build that publishes a custom uORB topic.

Set up the PX4 development environment on Ubuntu in the usual way:

cd
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
cd PX4-Autopilot/
make px4_sitl

Note that the above command will install the recommended emulator for your version of Ubuntu. If you want to install PX4 but keep your existing emulator, run it ubuntu.sh with the above --no-sim-tools flags.

For more information and troubleshooting, see: Ubuntu Development Environment and Downloading PX4 Source Code.