Ubuntu设置
Ubuntu linux lts(16.04)是标准的/首选的 Linux 开发操作系统。 Linux允许您构建所有PX4目标(基于NuttX的硬件、高通骁龙飞控硬件、基于Linux的硬件、仿真、ROS)。
Pixhawk and other NuttX-based hardware
ROS (1) (Robotics Operating System)
Fast DDS - Required for ROS2
This setup is supported by the PX4 dev team.
一键安装脚本
使用脚本:
@用户应先加入组 ”dialout“:
权限设置
Bash scripts are provided to help make it easy to install development environment for different target platforms. They are intended to be run on clean Ubuntu LTS installations.
Script | Description |
---|---|
Installs Gazebo 9 and jMAVSim simulators and/or NuttX/Pixhawk tools. Does not include dependencies for Fast DDS. | |
Installs ROS "Melodic" and PX4 on Ubuntu 18.04 LTS only. Do not use on Ubuntu 20.04 or later! |
ROS/Gazebo
Use the ubuntu.sh script to set up a development environment that includes Gazebo 9 and jMAVSim simulators, and/or the NuttX/Pixhawk toolchain.
ROS users must follow the instructions for: ROS/Gazebo.
To install the toolchain:
运行 bash 脚本(比如运行 ubuntu_sim.sh ): bash source ubuntu_sim.sh 所有弹出的提示均确认通过。
在安装过程中确认并通过所有的提示。
你可以通过传输参数
--no-nuttx
和--no-sim-tools
来跳过 nuttx 和/或 仿真器工具的安装。
完成后重新启动计算机。
::: details Information-only notes
** Note** PX4兼容Gazebo7、8和9。 上面的 安装说明 是关于安装 Gazebo 9 的。
You can verify the NuttX installation by confirming the gcc version as shown:
You're going to need the PX4 source code anyway. But if you just wanted to set up the development environment without getting all the source code you could instead just download ubuntu.sh and requirements.txt and then run ubuntu.sh:
:::<!-- Do we need to add to our scripts or can we assume correct version installs over? Remove any old versions of the arm-none-eabi toolchain.
-->
通用依赖
为 jMAVSim Simulation 安装依赖。
To build for Ubuntu 20.04 (focal) you must use docker (the GCC toolchain on Ubuntu 20.04 can build PX4, but the generated binary files are too new to run on actual Pi). For more information see PilotPi with Raspberry Pi OS Developer Quick Start > Alternative build method using docker.
本节解释如何安装 ROS/Gazebo ("Melodic") 以便与PX4一起使用。
Download ubuntu.sh and requirements.txt from the PX4 source repository (/Tools/setup/):
ubuntu_sim_nuttx.sh:ubuntu_sim.sh + NuttX 工具。
Then setup an cross-compiler (either GCC or clang) as described in the following sections.
如何使用脚本
Ubuntu software repository provides a set of pre-compiled toolchains. Note that Ubuntu Focal comes up with gcc-9-arm-linux-gnueabihf
as its default installation which is not fully supported, so we must manually install gcc-8-arm-linux-gnueabihf
and set it as the default toolchain. This guide also applies to earlier Ubuntu releases (Bionic). The following instruction assumes you haven't installed any version of arm-linux-gnueabihf, and will set up the default executable with update-alternatives
. Install them with the terminal command:
jMAVSim
sudo apt-get install protobuf-compiler libeigen3-dev libopencv-dev -y
Gazebo
First install GCC (needed to use clang).
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full -y
Detailed Information
Additional developer information for using PX4 on Raspberry Pi (including building PX4 natively) can be found here:
在安装高通骁龙飞控 或 树莓派/Parrot Bebop 之前, 你可以先运行它。
FastRTPS 安装
This section explains how to install ROS "Melodic" and PX4 on Ubuntu 18.04.
ROS builds are tied to specific Ubuntu versions! ROS Melodic can only install on Ubuntu 18.04.
To install the development toolchain:
Download the script in a bash shell:
下载脚本
随着脚本的运行,可能需要确认一些提示。
模拟器依赖
eProsima Fast DDS is required if you're using PX4 with ROS2 (or some other RTPS/DDS system).
Follow the instructions in Fast DDS Installation to install it.
Gazebo dependencies
Once you have finished setting up the command-line toolchain:
Install VSCode (if you prefer using an IDE to the command line).
Install the QGroundControl Daily Build
The daily build includes development tools that hidden in release builds. It may also provide access to new PX4 features that are not yet supported in release builds.
- Continue to the [build instructions](../dev_setup/building_px4.md).
Last updated