Skip to content

우분투 개발 환경

The following instructions use a bash script to set up the PX4 development environment on the Ubuntu Linux LTS versions supported by PX4: Ubuntu 22.04 (Jammy Jellyfish), 20.04 (Focal Fossa), and 18.04 (Bionic Beaver).

The environment includes:

The build toolchain for other flight controllers, simulators, and working with ROS are discussed in the Other Targets section below.

Simulation and NuttX (Pixhawk) Targets

Use the ubuntu.sh script to set up a development environment that allows you to build for simulators and/or the NuttX/Pixhawk toolchain.

TIP

The script is intended to be run on clean Ubuntu LTS installations, and may not work if run "on top" of an existing system, or on a different Ubuntu release.

툴체인을 설치하려면:

  1. PX4 소스 코드 다운로드합니다:

    sh
    git clone https://github.com/PX4/PX4-Autopilot.git --recursive

    The environment setup scripts in the source usually work for recent PX4 releases. If working with an older version of PX4 you may need to get the source code specific to your release.

:::

  1. 인수 없이 (bash 셸에서) ubuntu.sh를 실행합니다.

    sh
    bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
    • 스크립트가 진행되는 동안 모든 프롬프트를 확인합니다.
    • --no-nuttx--no-sim-tools 옵션을 사용하여 NuttX 및/또는 시뮬레이션 도구를 생략할 수 있습니다.
  2. 완료되면 컴퓨터를 재부팅합니다.

Details

Additional notes These notes are provided "for information only":

  • This setup is supported by the PX4 Dev Team. The instructions may also work on other Debian Linux based systems.

  • The script installs Gazebo "Garden" on Ubuntu 22.04, Gazebo Classic 11 on Ubuntu 20.04, and Gazebo Classic 9 on Ubuntu 18.04.

  • If you want to use Gazebo on Ubuntu 20.04 you can add it manually. See Gazebo > Installation.

  • You can verify the NuttX installation by confirming the gcc version as shown:

    sh
    $arm-none-eabi-gcc --version
    
    arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • 어쨌든 PX4 소스 코드가 필요합니다. 그러나 모든 소스 코드를 가져오지 않고 개발 환경을 설정하려는 경우 대신 ubuntu.shrequirements.txt를 다운로드한 다음 ubuntu.sh를 실행할 수 있습니다.:

    sh
    wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/ubuntu.sh
    wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt
    bash ubuntu.sh

영상 가이드

This video shows how to install the toolchain for NuttX and simulation targets (as covered below) along with the basic testing covered in Building PX4 Software.

WARNING

The video suggests that you build source using JMAVSim, entering the command: make px4_sitl jmavsim. As JMAVSim is now community-supported, you should instead build using Gazebo or Gazebo Classic, as shown in Building the Code

Other Targets

The Ubuntu development environment for ROS, other simulators, and other hardware targets, is covered in their respective documentation. A subset of the relevant topics are linked below.

라즈베리파이

ROS

다음 단계

명령줄 도구 모음 설정후, 다음을 수행합니다.

TIP

The daily build includes development tools that hidden in release builds. 또한, 릴리스 빌드에서 아직 지원되지 않는 새로운 PX4 기능에 대한 액세스를 제공할 수도 있습니다.