入门指南

本主题说明如何获取QGroundControl源代码并在本机或在Vagrant(虚拟机)环境中构建它。 本主题还提供其他可选功能信息及特定于操作系统的功能信息。

每日构建

如果您只是想测试 (而不是调试) 最近生成的 QGroundControl ,那么请使用Daily build。 官方提供了适用于所有平台的版本。

源代码

QGroundControl 的源代码保存在 github 上,下载地址为: https://github.com/mavlink/qgroundcontrol。 QGroundControl源代码在Apache 2.0和GPLv3下是双许可的。 有关更多信息,请参阅:许可证。

要获取源文件, 请执行以下操作:

  1. 克隆存储库 (或您的分叉), 包括子模块: git clone --recursive -j8 https://github.com/mavlink/qgroundcontrol.git
  2. 2.更新子模块(每次拉新源代码时都这样做): git submodule update --recursive

提示:不能使用Github以zip形式下载源文件,因为zip压缩包中不包含相应的子模块源代码。 你必须使用git工具!

构建QGroundControl开发环境

Using Containers

We support Linux builds using a container found on the source tree of the repository, which can help you develop and deploy the QGC apps without having to install any of the requirements on your local environment.

Container Guide

Native Builds

QGroundControl builds are supported for macOS, Linux, Windows, iOS and Android. QGroundControl uses Qt as its cross-platform support library and uses QtCreator as its default build environment.

  • macOS:v10.11或更高版本
  • Ubuntu:64位,gcc编译器
  • Windows: Vista or higher, Visual Studio 2017 compiler (64 bit)
  • iOS:10.0及更高版本
  • Android:Jelly Bean(4.1)及更高版本。 标准QGC是针对ndk 19版本构建的。
  • Qt version: 5.12.6 (only) >

    Warning Do not use any other version of Qt! QGC has been thoroughly tested with the specified version of Qt (5.12.6). There is a significant risk that other Qt versions will inject bugs that affect stability and safety (even if QGC compiles).

For more information see: Qt 5 supported platform list.

Native CentOS Builds are also supported, but are documented separately (as the tested environment is different).

安装 Visual Studio 2017(仅限Windows操作系统)

The Windows compiler can be found here: Visual Studio 2017 compiler (64 bit)

When installing, select Desktop development with C++ as shown:

Visual Studio 2017 - Select Desktop Environment with C++

安装Qt

You need to install Qt as described below instead of using pre-built packages from say, a Linux distribution, because QGroundControl needs access to private Qt headers.

To install Qt:

  1. 下载并运行Qt Online Installer

    • Ubuntu:
      • 使用以下命令将下载的文件设置为可执行文件:chmod + x
      • 请安装到默认位置, 以便与 ./qgroundcontrol-start.sh 一起使用。如果将 Qt 安装到非默认位置, 则需要修改 qgroundcontrol-start.sh ,才能运行下载的组件。
  2. 在安装程序 的*Select 组件 </0 > 对话框中, 选择 5.12.6。</p>

    If the version needed is not displayed, check the archive (show archive and refresh).

    然后,按如下向导,安装组件:</li> </ol>

    • Windows: MSVC 2017 64 bit
    • MacOS: macOS
    • Linux: Desktop gcc 64-bit
    • All:

      • Qt Charts

      • Android ARMv7 (to build Android)

        1. 安装附加软件包(特定于平台)
    • Ubuntu: sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev
    • Fedora: sudo dnf install speech-dispatcher SDL2-devel SDL2 systemd-devel
    • Arch Linux: pacman -Sy speech-dispatcher
    • Android: Qt Android Setup

      1. Install Optional/OS-Specific Functionality

        Optional features that are dependent on the operating system and user-installed libraries are linked/described below. These features can be forcibly enabled/disabled by specifying additional values to qmake.

    • Video Streaming/Gstreamer: - see Video Streaming.

      使用Qt Creator构建

    • 启动Qt Creator并打开qgroundcontrol.pro项目。

    • 根据您的需求选择合适的套件:

      • OSX:桌面Qt 5.12.6 clang 64 bit>注意iOS构建必须使用XCode构建。
      • Ubuntu: Desktop Qt 5.12.6 GCC 64bit
      • Windows: Desktop Qt 5.12.6 MSVC2017 64bit
      • Android: Android平台需选择armeabi的Android-v7a(GCC 4.9,Qt 5.12.6)
    • 使用"hammer" (or "play") 图标构建:

      QtCreator构建按键

      Build using qmake on CLI

      Example commands to build a default QGC and run it afterwards:

    • Make sure you cloned the repository and updated the submodules before, see chapter Source Code above and switch into the repository folder: cd qgroundcontrol

    • Create and enter a shadow build directory:

       mkdir build
       cd build
      
    • Configure the build using the qmake script in the root of the repository: qmake ../

    • Run make to compile and link. To accelerate the process things you can use the -j{number of threds} parameter. make -j12
    • Run the QGroundcontrol binary that was just built: ./staging/QGroundControl

      Vagrant

      Vagrant can be used to build and run QGroundControl within a Linux virtual machine (the build can also be run on the host machine if it is compatible).

    • Download and Install Vagrant

    • From the root directory of the QGroundControl repository run vagrant up
    • To use the graphical environment run vagrant reload

      Additional Build Notes for all Supported OS

    • 并行构建: 对于非Windows系统下的构建,您可以使用-j#选项来运行并行构建。

    • 构建文件的位置: 可以在build_debugbuild_release目录中找到单个构建文件结果。 可以在debugrelease目录中找到构建的可执行文件。
    • 如果在运行QGroundControl时出现报错: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found. ,则需将gcc更新到最新版本,或安装最新版本的libstdc++.6sudo apt-get install libstdc ++ 6
    • 单元测试: 如需运行unit tests,请使用UNITTEST_BUILD定义 debug模式,然后在运行测试之前将deploy / qgroundcontrol-start.sh脚本文件复制到 debug目录中。

      Building QGC Installation Files

      You can additionally create installation file(s) for QGroundControl as part of the normal build process.

      On Windows you will need to first install NSIS.

      To add support for installation file creation you need to add CONFIG+=installer to your project file, or when you call qmake.

      To do this in Qt Creator:

    • 打开 项目 > 构建 > 构建步骤 > qmake > 额外参数

    • 输入CONFIG+=installer安装器

results matching ""

    No results matching ""