Linux环境下的开发

Linux允许您构建所有PX4目标(基于NuttX的硬件、高通骁龙飞行硬件、基于Linux的硬件、仿真、ROS)。

Ubuntu Linux LTS 16.04 is the tested/supported Linux distribution for most development. Ubuntu 18.04 LTS with ROS Melodic is used for ROS development. Instructions are also provided for CentOS and Arch Linux.

下文说明了如何使用方便的bash脚本在Ubuntu LTS上设置开发环境。 有关手动安装和其他目标的说明, 可参见Ubuntu/Debian Linux

开发工具链

下问说明了如何使用bash脚本在Ubuntu上设置开发工具链。 以下脚本作用分别是安装Qt Creator IDE Ninja构建系统通用依赖项FastRTPS, 以及将PX4源下载到您的目录(~/src/Firmware)。

The scripts have been tested on clean Ubuntu LTS 16.04 and Ubuntu LTS 18.04 installations. 如果安装在除上述提到的系统或其他Ubuntu版本上, 则它们可能无法正常工作。 如果您遇到任何问题, 请参照手动安装说明操作。

First make the user a member of the group "dialout":

  1. 在命令提示符下输入:

     sh
     sudo usermod -a -G dialout $USER
    
  2. 注销并重新登录(更改后重新登录生效)。

请对应以下各部分中的开发目标说明进行操作。

Pixhawk/NuttX(和jMAVSim)

安装开发工具链:

  1. Download ubuntu_sim_nuttx.sh.
  2. 在bash shell中运行脚本:

     bash
     source ubuntu_sim_nuttx.sh 随着脚本的运行,可能需要确认一些提示。
    
  3. 完成后重新启动计算机。

高通骁龙飞控

PX4用户指南中提供了高通骁龙飞控的安装说明:

树莓派

安装开发工具链:

  1. Download ubuntu_sim_common_deps.sh (this contains the jMAVSim simulator and common toolchain dependencies).
  2. 在 bash shell 中运行脚本:

     bash
     source ubuntu_sim_common_deps.sh 随着脚本的运行,可能需要确认一些提示。
    
  3. 按照树莓PiUbuntu/Debian Linux中的安装说明进行。

Parrot Bepop

请按照此处的(手动)说明操作: Ubuntu/Debian Linux >Parrot Bebop

jMAVSim/Gazebo 模拟

To install the Gazebo9 and jMAVSim simulators:

  1. Download ubuntu_sim.sh.
  2. 在bash shell中运行脚本:
     bash 
     source ubuntu_sim.sh 随着脚本的运行,可能需要确认一些提示。
    

If you just need jMAVSim, instead download and run ubuntu_sim_common_deps.sh.

</p>

PX4兼容Gazebo7、8和9。 The script installs Gazebo 9.

Gazebo with ROS Melodic

PX4 is tested with ROS Melodic on Ubuntu 18.04 LTS. ROS Melodic does not work on Ubuntu 16.04.

To install the development toolchain:

  1. Download ubuntu_sim_ros_melodic.sh.
  2. Run the script in a bash shell:
    bash
    source ubuntu_sim_ros_melodic.sh
    You may need to acknowledge some prompts as the script progresses.

Note:

  • ROS Melodic is installed with Gazebo9 by default.
  • Your catkin (ROS build system) workspace is created at ~/catkin_ws/.

Additional Tools

After setting up the build/simulation toolchain, see Additional Tools for information about other useful tools.

Next Steps

Once you have finished setting up the environment, continue to the build instructions.

results matching ""

    No results matching ""