地面站终端 App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

239 lines
9.4 KiB

New Crowdin updates (#10902) * New translations joystick.md (Turkish) * New translations joystick.md (Persian) * New translations motors.md (Turkish) * New translations motors.md (Persian) * New translations motors_ardusub.md (Turkish) * New translations motors_ardusub.md (Persian) * New translations parameters.md (Turkish) * New translations parameters.md (Persian) * New translations power.md (Turkish) * New translations power.md (Persian) * New translations radio.md (Turkish) * New translations radio.md (Persian) * New translations safety.md (Turkish) * New translations safety.md (Persian) * New translations safety_ardupilot.md (Turkish) * New translations safety_ardupilot.md (Persian) * New translations sensors.md (Turkish) * New translations sensors.md (Persian) * New translations sensors_ardupilot.md (Turkish) * New translations sensors_ardupilot.md (Persian) * New translations sensors_px4.md (Turkish) * New translations sensors_px4.md (Persian) * New translations setup_view.md (Turkish) * New translations setup_view.md (Persian) * New translations tuning.md (Turkish) * New translations tuning.md (Persian) * New translations tuning_arducopter.md (Turkish) * New translations tuning_arducopter.md (Persian) * New translations tuning_ardupilot.md (Persian) * New translations tuning_ardusub.md (Russian) * New translations tuning_px4.md (Russian) * New translations support.md (Russian) * New translations toolbar.md (Russian) * New translations index.md (Russian) * New translations parameter_download.md (Russian) * New translations plan_upload_download.md (Russian) * New translations qgc.ts (Korean) * New translations qgc.ts (Russian) * New translations qgc.ts (Turkish) * New translations tuning_ardusub.md (Turkish) * New translations tuning_ardusub.md (Persian) * New translations tuning_px4.md (Turkish) * New translations tuning_px4.md (Persian) * New translations support.md (Turkish) * New translations support.md (Persian) * New translations toolbar.md (Turkish) * New translations toolbar.md (Persian) * New translations index.md (Persian) * New translations parameter_download.md (Turkish) * New translations parameter_download.md (Persian) * New translations qgc.ts (Chinese Simplified) * New translations qgc.ts (Persian) * New translations index.md (Chinese Simplified) * New translations command_line_options.md (Chinese Simplified) * New translations communication_flow.md (Chinese Simplified) * New translations coding_style.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations licences.md (Chinese Simplified) * New translations pull_requests.md (Chinese Simplified) * New translations unit_tests.md (Chinese Simplified) * New translations custom_build.md (Chinese Simplified) * New translations fact_system.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations mavlink.md (Chinese Simplified) * New translations parameters.md (Chinese Simplified) * New translations plan.md (Chinese Simplified) * New translations firmware_plugin.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations mock_link.md (Chinese Simplified) * New translations controls.md (Chinese Simplified) * New translations font_palette.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations multi_device_pattern.md (Chinese Simplified) * New translations fly.md (Chinese Simplified) * New translations setup.md (Chinese Simplified) * New translations geotag_images.md (Korean) * New translations geotag_images.md (Turkish) * New translations geotag_images.md (Chinese Simplified) * New translations index.md (Korean) * New translations index.md (Chinese Simplified) * New translations log_download.md (Korean) * New translations log_download.md (Turkish) * New translations mavlink_console.md (Korean) * New translations mavlink_console.md (Chinese Simplified) * New translations mavlink_inspector.md (Korean) * New translations mavlink_inspector.md (Chinese Simplified) * New translations fly_view.md (Korean) * New translations fly_view.md (Turkish) * New translations fly_view.md (Chinese Simplified) * New translations replay_flight_data.md (Korean) * New translations replay_flight_data.md (Turkish) * New translations replay_flight_data.md (Chinese Simplified) * New translations video_overlay.md (Korean) * New translations video_overlay.md (Turkish) * New translations video_overlay.md (Chinese Simplified) * New translations download_and_install.md (Korean) * New translations download_and_install.md (Turkish) * New translations download_and_install.md (Chinese Simplified) * New translations quick_start.md (Korean) * New translations quick_start.md (Turkish) * New translations quick_start.md (Chinese Simplified) * New translations index.md (Korean) * New translations index.md (Chinese Simplified) * New translations pattern.md (Korean) * New translations pattern.md (Turkish) * New translations pattern.md (Chinese Simplified) * New translations pattern_corridor_scan.md (Korean) * New translations pattern_corridor_scan.md (Turkish) * New translations pattern_corridor_scan.md (Chinese Simplified) * New translations pattern_fixed_wing_landing.md (Korean) * New translations pattern_fixed_wing_landing.md (Turkish) * New translations pattern_fixed_wing_landing.md (Chinese Simplified) * New translations pattern_presets.md (Korean) * New translations pattern_presets.md (Turkish) * New translations pattern_presets.md (Chinese Simplified) * New translations pattern_structure_scan_v2.md (Korean) * New translations pattern_structure_scan_v2.md (Turkish) * New translations pattern_structure_scan_v2.md (Chinese Simplified) * New translations pattern_survey.md (Korean) * New translations pattern_survey.md (Turkish) * New translations pattern_survey.md (Chinese Simplified) * New translations plan_geofence.md (Korean) * New translations plan_geofence.md (Turkish) * New translations plan_geofence.md (Chinese Simplified) * New translations plan_rally_points.md (Korean) * New translations plan_rally_points.md (Turkish) * New translations plan_rally_points.md (Chinese Simplified) * New translations plan_view.md (Korean) * New translations plan_view.md (Turkish) * New translations plan_view.md (Chinese Simplified) * New translations daily_build_new_features.md (Korean) * New translations daily_build_new_features.md (Chinese Simplified) * New translations daily_builds.md (Korean) * New translations daily_builds.md (Chinese Simplified) * New translations index.md (Korean) * New translations privacy_policy.md (Korean) * New translations release_notes.md (Korean) * New translations release_notes.md (Chinese Simplified) * New translations stable_v3.2_long.md (Korean) * New translations stable_v3.2_long.md (Chinese Simplified) * New translations stable_v3.3_long.md (Korean) * New translations stable_v3.3_long.md (Chinese Simplified) * New translations stable_v4.0_additional.md (Korean) * New translations stable_v4.0_additional.md (Chinese Simplified) * New translations console_logging.md (Korean) * New translations console_logging.md (Turkish) * New translations console_logging.md (Chinese Simplified) * New translations csv.md (Korean) * New translations csv.md (Chinese Simplified) * New translations general.md (Korean) * New translations general.md (Turkish) * New translations general.md (Chinese Simplified) * New translations mavlink.md (Korean) * New translations mavlink.md (Chinese Simplified) * New translations offline_maps.md (Turkish) * New translations settings_view.md (Korean) * New translations settings_view.md (Turkish) * New translations virtual_joystick.md (Korean) * New translations virtual_joystick.md (Chinese Simplified) * New translations airframe.md (Korean) * New translations airframe.md (Turkish) * New translations airframe.md (Chinese Simplified) * New translations airframe_ardupilot.md (Korean) * New translations airframe_ardupilot.md (Turkish) * New translations airframe_ardupilot.md (Chinese Simplified) * New translations airframe_px4.md (Korean) * New translations airframe_px4.md (Turkish) * New translations airframe_px4.md (Chinese Simplified) * New translations camera.md (Korean) * New translations camera.md (Turkish) * New translations camera.md (Chinese Simplified) * New translations firmware.md (Korean) * New translations firmware.md (Turkish) * New translations firmware.md (Chinese Simplified) * New translations flight_modes.md (Korean) * New translations flight_modes.md (Turkish) * New translations flight_modes.md (Chinese Simplified) * New translations flight_modes_ardupilot.md (Korean) * New translations flight_modes_ardupilot.md (Turkish) * New translations flight_modes_ardupilot.md (Chinese Simplified) * New translations flight_modes_px4.md (Korean) * New translations flight_modes_px4.md (Turkish) * New translations flight_modes_px4.md (Chinese Simplified) * New translations joystick.md (Korean) * New translations joystick.md (Turkish) * New translations joystick.md (Chinese Simplified) * New translations motors.md (Korean) * New translations motors.md (Turkish) * New translations motors.md (Chinese Simplified) * New translations motors_ardusub.md (Korean) * New translations motors_ardusub.md (Turkish) * New translations motors_ardusub.md (Chinese Simplified) * New translations parameters.md (Korean) * New translations parameters.md (Turkish) * New translations parameters.md (Chinese Simplified) * New translations power.md (Korean) * New translations power.md (Turkish) * New translations power.md (Chinese Simplified) * New translations radio.md (Korean) * New translations radio.md (Turkish) * New translations radio.md (Chinese Simplified) * New translations safety.md (Korean) * New translations safety.md (Chinese Simplified) * New translations safety_ardupilot.md (Korean) * New translations safety_ardupilot.md (Turkish) * New translations safety_ardupilot.md (Chinese Simplified) * New translations sensors.md (Korean) * New translations sensors.md (Turkish) * New translations sensors.md (Chinese Simplified) * New translations sensors_ardupilot.md (Korean) * New translations sensors_ardupilot.md (Turkish) * New translations sensors_ardupilot.md (Chinese Simplified) * New translations sensors_px4.md (Korean) * New translations sensors_px4.md (Turkish) * New translations sensors_px4.md (Chinese Simplified) * New translations setup_view.md (Korean) * New translations setup_view.md (Turkish) * New translations setup_view.md (Chinese Simplified) * New translations tuning.md (Korean) * New translations tuning.md (Chinese Simplified) * New translations tuning_arducopter.md (Korean) * New translations tuning_arducopter.md (Chinese Simplified) * New translations tuning_ardusub.md (Korean) * New translations tuning_ardusub.md (Chinese Simplified) * New translations tuning_px4.md (Korean) * New translations tuning_px4.md (Turkish) * New translations tuning_px4.md (Chinese Simplified) * New translations support.md (Korean) * New translations support.md (Turkish) * New translations support.md (Chinese Simplified) * New translations toolbar.md (Korean) * New translations toolbar.md (Turkish) * New translations toolbar.md (Chinese Simplified) * New translations index.md (Korean) * New translations parameter_download.md (Korean) * New translations parameter_download.md (Chinese Simplified) * New translations qgc_setup.md (Korean) * New translations qgc_setup.md (Turkish) * New translations qgc_setup.md (Chinese Simplified) * New translations qgc_usage.md (Korean) * New translations qgc_usage.md (Turkish) * New translations qgc_usage.md (Chinese Simplified) * New translations resume_mission.md (Korean) * New translations resume_mission.md (Turkish) * New translations resume_mission.md (Chinese Simplified) * New translations vehicle_connection.md (Korean) * New translations vehicle_connection.md (Turkish) * New translations vehicle_connection.md (Chinese Simplified)
1 year ago
---
qt_version: 5.15.2
---
# Getting Started
This topic explains how to get the _QGroundControl_ source code and build it either natively or within a _Vagrant_ environment.
It also provides information about optional or OS specific functionality.
## Daily Builds
If you just want to test (and not debug) a recent build of _QGroundControl_ you can use the [Daily Build](https://docs.qgroundcontrol.com/en/releases/daily_builds.html). Versions are provided for all platforms.
## Source Code
Source code for _QGroundControl_ is kept on GitHub here: https\://github.com/mavlink/qgroundcontrol.
It is [dual-licensed under Apache 2.0 and GPLv3](https://github.com/mavlink/qgroundcontrol/blob/master/COPYING.md).
To get the source files:
1. Clone the repo (or your fork) including submodules:
```
git clone --recursive -j8 https://github.com/mavlink/qgroundcontrol.git
```
2. Update submodules (required each time you pull new source code):
```
git submodule update --recursive
```
:::tip
Github source-code zip files cannot be used because these do not contain the appropriate submodule source code.
You must use git!
:::
## Build 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](../getting_started/container.md)
### Native Builds
_QGroundControl_ builds are supported for macOS, Linux, Windows, iOS and Android.
_QGroundControl_ uses [Qt](http://www.qt.io) as its cross-platform support library and uses [QtCreator](http://doc.qt.io/qtcreator/index.html) as its default build environment.
- **macOS:** v10.11 or higher
- **Ubuntu:** 64 bit, gcc compiler
- **Windows:** Vista or higher, [Visual Studio 2019 compiler](#vs) (64 bit)
- **iOS:** 10.0 and higher
- **Android:** Android 5.0 and later.
- Standard QGC is built against ndk version 19.
- Java JDK 11 is required.
- **Qt version:** {{ $frontmatter.qt\_version }} **(only)** <!-- NOTE {{ $frontmatter.qt_version }} is set in the frontmatter above -->
::: warning
**Do not use any other version of Qt!**
QGC has been thoroughly tested with the specified version of Qt ({{ $frontmatter.qt\_version }}).
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](http://doc.qt.io/qt-5/supported-platforms.html).
:::info
Native [CentOS Builds](../getting_started/cent_os.md) are also supported, but are documented separately (as the tested environment is different).
:::
#### Install Visual Studio 2019 (Windows Only) {#vs}
The Windows compiler can be found here: [Visual Studio 2019 compiler](https://visualstudio.microsoft.com/vs/older-downloads/) (64 bit)
When installing, select _Desktop development with C++_ as shown:
![Visual Studio 2019 - Select Desktop Environment with C++](../../../assets/dev_getting_started/visual_studio_select_features.png)
:::info
Visual Studio is ONLY used to get the compiler. Actually building _QGroundControl_ should be done using [Qt Creator](#qt-creator) or [qmake](#qmake) as outlined below.
:::
#### Install 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. Download and run the [Qt Online Installer](http://www.qt.io/download-open-source)
- **Ubuntu:**
- Set the downloaded file to executable using: `chmod +x`.
- Install to default location for use with **./qgroundcontrol-start.sh.** If you install Qt to a non-default location you will need to modify **qgroundcontrol-start.sh** in order to run downloaded builds.
2. In the installer _Select Components_ dialog choose: {{ $frontmatter.qt\_version }}.
::: info
If the version needed is not displayed, check the archive (show archive and refresh).
:::
Then install just the following components:
- **Windows**: _MSVC 2019 64 bit_
- **MacOS**: _macOS_
- **Linux**: _Desktop gcc 64-bit_
- All:
- _Qt Charts_ <!-- and *Qt Remote Objects (TP)* -->
- _Android ARMv7_ (optional, used to build Android)
![QtCreator Select Components (Windows)](../../../assets/dev_getting_started/qt_creator_select_components.jpg)
3. Install Additional Packages (Platform Specific)
- **Ubuntu:** `sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev patchelf build-essential curl`
- **Fedora:** `sudo dnf install speech-dispatcher SDL2-devel SDL2 systemd-devel patchelf`
- **Arch Linux:** `pacman -Sy speech-dispatcher patchelf`
- **Android:** [Qt Android Setup](http://doc.qt.io/qt-5/androidgs.html)
::: info
JDK11 is required (install if needed)!
:::
4. Install Optional/OS-Specific Functionality
::: info
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](https://github.com/mavlink/qgroundcontrol/blob/master/src/VideoReceiver/README.md).
- **Airmap SDK:** - TBD.
5. Disable platform-specific optional features that are enabled (but not installed), by default.
::: info
This currently applies to Airmap on Linux, which is optional but enabled by default.
:::
- **Ubuntu:**
- Airmap: Create a file named **user\_config.pri** (in the repo root directory) containing the text `DEFINES += DISABLE_AIRMAP`.
This can be done in a bash terminal using the command:
```
echo -e "DEFINES += DISABLE_AIRMAP\r\n" | tee user_config.pri
```
#### Building using Qt Creator {#qt-creator}
1. Launch _Qt Creator_ and open the **qgroundcontrol.pro** project.
2. In the **Projects** section, select the appropriate kit for your needs:
- **OSX:** Desktop Qt {{ $frontmatter.qt\_version }} clang 64 bit
::: info
iOS builds must be built using [XCode](http://doc.qt.io/qt-5/ios-support.html).
:::
- **Ubuntu:** Desktop Qt {{ $frontmatter.qt\_version }} GCC 64bit
- **Windows:** Desktop Qt {{ $frontmatter.qt\_version }} MSVC2019 **64bit**
- **Android:** Android for armeabi-v7a (GCC 4.9, Qt {{ $frontmatter.qt\_version }})
- JDK11 is required.
You can confirm it is being used by reviewing the project setting: **Projects > Manage Kits > Devices > Android (tab) > Android Settings > _JDK location_**.
3. Build using the "hammer" (or "play") icons:
![QtCreator Build Button](../../../assets/dev_getting_started/qt_creator_build_qgc.png)
#### Build using qmake on CLI {#qmake}
Example commands to build a default QGC and run it afterwards:
1. Make sure you cloned the repository and updated the submodules before, see chapter _Source Code_ above and switch into the repository folder:
```
cd qgroundcontrol
```
2. Create and enter a shadow build directory:
```
mkdir build
cd build
```
3. Configure the build using the qmake script in the root of the repository:
```
qmake ../
```
4. Run make to compile and link.
To accelerate the process things you can use the `-j{number of threads}` parameter.
```
make -j12
```
::: info
You can also specify build time flags here.
For example, you could disable airmap inclusion using the command:
```
DEFINES+=DISABLE_AIRMAP make build
```
:::
5. Run the QGroundcontrol binary that was just built:
```
./staging/QGroundControl
```
### Vagrant
[Vagrant](https://www.vagrantup.com/) 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).
1. [Download](https://www.vagrantup.com/downloads.html) and [Install](https://www.vagrantup.com/docs/getting-started/) Vagrant
2. From the root directory of the _QGroundControl_ repository run `vagrant up`
3. To use the graphical environment run `vagrant reload`
### Additional Build Notes for all Supported OS
- **Parallel builds:** For non Windows builds, you can use the `-j#` option to run parellel builds.
- **Location of built files:** Individual build file results can be found in the `build_debug` or `build_release` directories. The built executable can be found in the `debug` or `release` directory.
- **If you get this error when running _QGroundControl_**: `/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found.`, you need to either update to the latest _gcc_, or install the latest _libstdc++.6_ using: `sudo apt-get install libstdc++6`.
- **Unit tests:** To run the [unit tests](../contribute/unit_tests.md), build in `debug` mode with `UNITTEST_BUILD` definition, and then copy `deploy/qgroundcontrol-start.sh` script into the `debug` directory before running the tests.
## Building QGC Installation Files
You can additionally create installation file(s) for _QGroundControl_ as part of the normal build process.
:::tip
On Windows you will need to first install [NSIS](https://sourceforge.net/projects/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_:
- Open **Projects > Build > Build Steps > qmake > Additional arguments**.
- Enter `CONFIG+=installer` as shown:
![Installer](../../../assets/dev_getting_started/qt_project_installer.png)