首页 最新 热门 推荐

  • 首页
  • 最新
  • 热门
  • 推荐

QGroundControl@Jetson Orin Nano - 从代码编译安装

  • 25-02-20 11:40
  • 3617
  • 5144
blog.csdn.net

QGroundControl@Jetson Orin Nano - Build from Source

  • 1. 源由
  • 2. 步骤
    • 2.1 QT 编译
      • 2.1.1 下载
      • 2.1.2 版本
      • 2.1.3 初始化
      • 2.1.4 配置
      • 2.1.5 编译
      • 2.1.6 安装
    • 2.2 QGC 编译
      • 2.2.1 下载
      • 2.2.2 版本
      • 2.2.3 初始化
      • 2.2.4 配置
      • 2.2.5 编译
      • 2.2.6 安装
      • 2.2.7 QT5命令备注
  • 3. 可行方案
  • 4. 总结
  • 5. 补充 - 问题清单
    • 5.1 cmake配置命令错误
    • 5.2 qtconnectivity5-dev库问题
    • 5.3 libqt5charts5-dev库问题
    • 5.4 qtlocation5-dev库问题
    • 5.5 qtpositioning5-dev库问题
    • 5.6 qtmultimedia5-dev库问题
    • 5.7 qtquickcontrols2-5-dev库问题
    • 5.8 libqt5svg5-dev库问题
    • 5.9 libqt5texttospeech5-dev库问题
    • 5.10 libqt5serialport5-dev库问题
    • 5.11 libqt5x11extras5-dev库问题
    • 5.12 cmake版本问题
    • 5.13 修改CMakeList.txt

1. 源由

先说结论:直接从QGroundControl代码在Jetson Orin Nano板子上编译不成功!

按照以下文档中的步骤和方法进行编译,最后卡在:

  1. Getting Started with Source and Builds
  2. Building Qt 6 from Git
/home/daniel/QGC/qgroundcontrol/libs/qmlglsink/qt6/gstqt6glutility.cc: In function ‘GstGLDisplay* gst_qml6_get_gl_display(gboolean)’:
/home/daniel/QGC/qgroundcontrol/libs/qmlglsink/qt6/gstqt6glutility.cc:94:62: error: ‘QX11Application’ is not a member of ‘QNativeInterface’; did you mean ‘QWaylandApplication’?
   94 |     auto x11_native = app->nativeInterface<QNativeInterface::QX11Application>();
      |                                                              ^~~~~~~~~~~~~~~
      |                                                              QWaylandApplication
/home/daniel/QGC/qgroundcontrol/libs/qmlglsink/qt6/gstqt6glutility.cc:94:79: error: no matching function for call to ‘QGuiApplication::nativeInterface<<expression error> >()’
   94 |     auto x11_native = app->nativeInterface<QNativeInterface::QX11Application>();
      |                                                                               ^
In file included from /home/daniel/QGC/qt6/qt6-install/include/QtCore/qcoreapplication.h:16,
                 from /home/daniel/QGC/qt6/qt6-install/include/QtGui/qguiapplication.h:8,
                 from /home/daniel/QGC/qt6/qt6-install/include/QtGui/QGuiApplication:1,
                 from /home/daniel/QGC/qgroundcontrol/libs/qmlglsink/qt6/gstqt6glutility.cc:26:
/home/daniel/QGC/qt6/qt6-install/include/QtGui/qguiapplication.h:142:5: note: candidate: ‘template<class NativeInterface, class TypeInfo, class BaseType, typename std::enable_if<TypeInfo::isCompatibleWith<QGuiApplication>, bool>::type <anonymous> > NativeInterface* QGuiApplication::nativeInterface() const’
  142 |     QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/daniel/QGC/qt6/qt6-install/include/QtGui/qguiapplication.h:142:5: note:   template argument deduction/substitution failed:
/home/daniel/QGC/qgroundcontrol/libs/qmlglsink/qt6/gstqt6glutility.cc:94:79: error: template argument 1 is invalid
   94 |     auto x11_native = app->nativeInterface<QNativeInterface::QX11Application>();
      |                                                                               ^
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-unused-private-field’
ninja: build stopped: subcommand failed.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

2. 步骤

注:/path/to/install是安装路径,请根据实际需要进行安装目录调整。

2.1 QT 编译

注:推荐使用6.6.3版本,但是笔者也试过5.15.2

  • QGC最新master(5a348d3) + QT6.6.3 ==》失败
  • QGC-Stable4.4 + QT6.6.3 ==》失败
  • QGC-Stable4.4 + QT5.15.2 ==》失败

2.1.1 下载

$ git clone git://code.qt.io/qt/qt5.git qt6
  • 1

2.1.2 版本

$ cd qt6
$ git checkout 6.6.3
  • 1
  • 2

2.1.3 初始化

$ perl init-repository
  • 1

2.1.4 配置

$ mkdir qt6-build
$ ./configure -prefix /path/to/install
  • 1
  • 2

2.1.5 编译

$ cmake --build . --parallel 4
  • 1

2.1.6 安装

$ cmake --install .
  • 1

2.2 QGC 编译

2.2.1 下载

$ git clone --recursive -j8 https://github.com/mavlink/qgroundcontrol.git
  • 1

2.2.2 版本

$ cd qgroundcontrol
$ git checkout Stable_V4.4
  • 1
  • 2

2.2.3 初始化

$ git submodule update --recursive
  • 1

2.2.4 配置

$ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/path/to/install
  • 1

2.2.5 编译

$ cmake --build build --config Debug
  • 1

注:改步骤由于X11(QNativeInterface::QX11Application)的问题,始终无法通过,换衣X11依赖等方面在Jetson Orin Nano上存在一些问题。

2.2.6 安装

$ ./build/QGroundControl
  • 1

2.2.7 QT5命令备注

$ git clone git://code.qt.io/qt/qt5.git qt5
$ git checkout 5.15.2
$ perl init-repository
$ mkdir qt5-build
$ ./configure -prefix /path/to/install
$ make
$ make install
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

3. 可行方案

采用Installing-QGroundControl-on-Ubuntu-ARM64-using-Flatpak) 方案安装可行。

在这里插入图片描述

4. 总结

如果有朋友知道如何解决上述问题,也请告知,谢谢!

相关内容的进一步讨论: How did Flatpak build QGC for Jetson? #1

5. 补充 - 问题清单

5.1 cmake配置命令错误

$ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/path/to/install
  • 1
$ cmake -B build -G Ninja CMAKE_BUILD_TYPE=Debug
CMake Error: The source directory "/home/daniel/QGC/qgroundcontrol/CMAKE_BUILD_TYPE=Debug" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.


$ cmake -B build -G Ninja
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.22.1 or higher is required.  You are running version 3.16.3


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

5.2 qtconnectivity5-dev库问题

$ sudo apt-get install qtconnectivity5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Bluetooth" with
  any of the following names:

    Qt5BluetoothConfig.cmake
    qt5bluetooth-config.cmake

  Add the installation prefix of "Qt5Bluetooth" to CMAKE_PREFIX_PATH or set
  "Qt5Bluetooth_DIR" to a directory containing one of the above files.  If
  "Qt5Bluetooth" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/daniel/QGC/qgroundcontrol/build/CMakeFiles/CMakeOutput.log".
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

5.3 libqt5charts5-dev库问题

$ sudo apt-get install libqt5charts5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Charts" with
  any of the following names:

    Qt5ChartsConfig.cmake
    qt5charts-config.cmake

  Add the installation prefix of "Qt5Charts" to CMAKE_PREFIX_PATH or set
  "Qt5Charts_DIR" to a directory containing one of the above files.  If
  "Qt5Charts" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/daniel/QGC/qgroundcontrol/build/CMakeFiles/CMakeOutput.log".
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

5.4 qtlocation5-dev库问题

$ sudo apt-get install qtlocation5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Location" with
  any of the following names:

    Qt5LocationConfig.cmake
    qt5location-config.cmake

  Add the installation prefix of "Qt5Location" to CMAKE_PREFIX_PATH or set
  "Qt5Location_DIR" to a directory containing one of the above files.  If
  "Qt5Location" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.5 qtpositioning5-dev库问题

$ sudo apt-get install qtpositioning5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5Location/Qt5LocationConfig.cmake:101 (find_package):
  Could not find a package configuration file provided by
  "Qt5PositioningQuick" (requested version 5.12.8) with any of the following
  names:

    Qt5PositioningQuickConfig.cmake
    qt5positioningquick-config.cmake

  Add the installation prefix of "Qt5PositioningQuick" to CMAKE_PREFIX_PATH
  or set "Qt5PositioningQuick_DIR" to a directory containing one of the above
  files.  If "Qt5PositioningQuick" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

5.6 qtmultimedia5-dev库问题

$ sudo apt-get install qtmultimedia5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Multimedia"
  with any of the following names:

    Qt5MultimediaConfig.cmake
    qt5multimedia-config.cmake

  Add the installation prefix of "Qt5Multimedia" to CMAKE_PREFIX_PATH or set
  "Qt5Multimedia_DIR" to a directory containing one of the above files.  If
  "Qt5Multimedia" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.7 qtquickcontrols2-5-dev库问题

$ sudo apt-get install qtquickcontrols2-5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5QuickControls2"
  with any of the following names:

    Qt5QuickControls2Config.cmake
    qt5quickcontrols2-config.cmake

  Add the installation prefix of "Qt5QuickControls2" to CMAKE_PREFIX_PATH or
  set "Qt5QuickControls2_DIR" to a directory containing one of the above
  files.  If "Qt5QuickControls2" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.8 libqt5svg5-dev库问题

$ sudo apt-get install libqt5svg5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Svg" with any
  of the following names:

    Qt5SvgConfig.cmake
    qt5svg-config.cmake

  Add the installation prefix of "Qt5Svg" to CMAKE_PREFIX_PATH or set
  "Qt5Svg_DIR" to a directory containing one of the above files.  If "Qt5Svg"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.9 libqt5texttospeech5-dev库问题

$ sudo apt-get install libqt5texttospeech5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5TextToSpeech"
  with any of the following names:

    Qt5TextToSpeechConfig.cmake
    qt5texttospeech-config.cmake

  Add the installation prefix of "Qt5TextToSpeech" to CMAKE_PREFIX_PATH or
  set "Qt5TextToSpeech_DIR" to a directory containing one of the above files.
  If "Qt5TextToSpeech" provides a separate development package or SDK, be
  sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.10 libqt5serialport5-dev库问题

$ sudo apt-get install libqt5serialport5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5SerialPort"
  with any of the following names:

    Qt5SerialPortConfig.cmake
    qt5serialport-config.cmake

  Add the installation prefix of "Qt5SerialPort" to CMAKE_PREFIX_PATH or set
  "Qt5SerialPort_DIR" to a directory containing one of the above files.  If
  "Qt5SerialPort" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:149 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.11 libqt5x11extras5-dev库问题

$ sudo apt-get install libqt5x11extras5-dev
  • 1
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5X11Extras" with
  any of the following names:

    Qt5X11ExtrasConfig.cmake
    qt5x11extras-config.cmake

  Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set
  "Qt5X11Extras_DIR" to a directory containing one of the above files.  If
  "Qt5X11Extras" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  libs/qmlglsink/CMakeLists.txt:26 (find_package)


-- Configuring incomplete, errors occurred!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

5.12 cmake版本问题

cmake必须是3.22版本以上才能进行配置、编译。

$ sudo apt-get remove --purge cmake
$ tar -zxvf cmake-3.22.1.tar.gz
$ cd cmake-3.22.1
$ ./bootstrap
$ make
$ sudo make install
$ cmake --version
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

5.13 修改CMakeList.txt

$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 765e4f450..89a3625d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,10 @@ include(CMakePrintHelpers)

 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(OpenGL_GL_PREFERENCE "GLVND")
+set(CMAKE_PREFIX_PATH "/path/to/install")
+
+
 if(LINUX)
     set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/AppDir/usr)
 else()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
注:本文转载自blog.csdn.net的lida2003的文章"https://blog.csdn.net/lida2003/article/details/140066960"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
复制链接
复制链接
相关推荐
发表评论
登录后才能发表评论和回复 注册

/ 登录

评论记录:

未查询到任何数据!
回复评论:

分类栏目

后端 (14832) 前端 (14280) 移动开发 (3760) 编程语言 (3851) Java (3904) Python (3298) 人工智能 (10119) AIGC (2810) 大数据 (3499) 数据库 (3945) 数据结构与算法 (3757) 音视频 (2669) 云原生 (3145) 云平台 (2965) 前沿技术 (2993) 开源 (2160) 小程序 (2860) 运维 (2533) 服务器 (2698) 操作系统 (2325) 硬件开发 (2492) 嵌入式 (2955) 微软技术 (2769) 软件工程 (2056) 测试 (2865) 网络空间安全 (2948) 网络与通信 (2797) 用户体验设计 (2592) 学习和成长 (2593) 搜索 (2744) 开发工具 (7108) 游戏 (2829) HarmonyOS (2935) 区块链 (2782) 数学 (3112) 3C硬件 (2759) 资讯 (2909) Android (4709) iOS (1850) 代码人生 (3043) 阅读 (2841)

热门文章

101
推荐
关于我们 隐私政策 免责声明 联系我们
Copyright © 2020-2025 蚁人论坛 (iYenn.com) All Rights Reserved.
Scroll to Top