Setting Up PX4 Development Environment – ROS2 + PX4 Toolchain

Hello! I am Aiden from the marketing team.

Today, I would like to introduce the PX4 development environment setup, specifically the ROS2 + PX4 Toolchain configuration. Please note that this content is registered under the copyright of our QUAD Drone Lab, and we kindly ask that you refrain from unauthorized distribution.


ROS2 + PX4 Toolchain Configuration

Please proceed with the following steps in sequence, alongside the YouTube video provided below.

재생

1. Install Ubuntu 22.04 + ROS2 Humble

Please refer to the following link for the ROS2 Humble installation:

2. Install PX4 Toolchain

  1. PX4 Source Code Download:
Bash
   git clone https://github.com/PX4/PX4-Autopilot.git --recursive

MEMO

The environment setup scripts within the source code generally work with the latest PX4 releases.

However, if you are working with an older version of PX4, you may need to obtain the specific source code that corresponds to that particular release.

  1. To install everything, run ubuntu.sh without any arguments in the bash shell:
Bash
   bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
  • Check all prompts while the script is running.
  • You can omit NuttX and/or simulation tools by using the --no-nuttx and --no-sim-tools options.

3. Restart your computer once the installation is complete.

3. Install MAVROS

Binary Installation (Debian/Ubuntu)

The ROS repository contains binary packages for Ubuntu x86, amd64 (x86_64), and armhf (ARMv7).
Kinetic also supports Debian Jessie amd64 and arm64 (ARMv8).

Bash
sudo apt-get install ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs

Then, install GeographicLib(Open a new window). Run the script to install the datasets:
install_geographiclib_datasets.sh:

Bash
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash ./install_geographiclib_datasets.sh

4. Install QGroundControl

Installation References : https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html

5. Launch PX4 SiTL

Bash
#SITL 실행
cd ~/PX4-Autopilot
make px4_sitl gz_x500

ROS2 Environment Variable Samples for .bashrc

gedit ~/.bashrc

Bash
### ROS2 Evn.
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash

source /usr/share/colcon_cd/function/colcon_cd.sh
export _colcon_cd_root=/opt/ros/humble/

alias humble="source /opt/ros/humble/setup.bash; echo \"ROS2 Humble is activated\""
alias ws="source ~/ros2_ws/install/setup.bash; echo \"ROS2_WS is activated\""
alias iron="source /opt/ros/iron/setup.bash; echo \"ROS2 Iron is activated\""
alias cb="colcon build --symlink-install"
alias cbe="colcon build --symlink-install --event-handlers console_direct+"
alias cbp="colcon build --packages-select -symlink-install --event-handlers console_direct+"


This concludes the fourth step of the PX4 development environment setup: Installing the ROS2 + PX4 Toolchain. In our next session, we will return with the final step: Configuring and Using the Gazebo Simulator.


Author: Aiden, Marketing Director of QUAD Drone Lab

DATE: February 20, 2026

Similar Posts

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다