香橙派的ubuntu20.04系统中运行QGroundControl

摘要

在orangepi5pro的ubuntu20.04系统中运行qgroundcontrol地面站,实现对APM固件的PX4飞控的控制.

关键信息

  • 飞控硬件:Pixhawk 2.4.8
  • 飞控固件:ArduPilot 4.2.0
  • 运行环境:orangepi5pro(RK3588S)
  • 运行系统:ubuntu 20.04
  • QGroundControl版本:4.3.0

原理简介

QGroundControl简介

[https://blog.csdn.net/u010168781/article/details/132869605]
[http://qgroundcontrol.com]
QGroundControl provides full flight control and mission planning for any MAVLink enabled drone. Its primary goal is ease of use for professional users and developers. All the code is open-source source, so you can contribute and evolve it as you want.
QGroundControl为任何启用MAVLink的无人机提供完整的飞行控制和任务规划。它的主要目标是方便专业用户和开发人员使用。所有代码都是开源的,所以您可以随心所欲地贡献和发展它。

flatpak简介

[https://flatpak.org]
A new world for application developers
Flatpak changes app distribution for the better. Advantages include:

Build for every distro
Create one app and distribute it to the entire Linux desktop market.

Stable platforms
Runtimes provide platforms of common libraries that you can depend on.

Consistent environments
Develop and test your application in an environment that’s identical to the one users have.

Full control over dependencies
Flatpak makes it easy to bundle your own libraries as part of your app.

Easy build tools
Flatpak’s build tools are simple and easy to use, and come with a full set of documentation.

Future-proof builds
Flatpak apps continue to be compatible with new versions of Linux distributions.

Distribution made easy
Make your app available to a rapidly growing audience of Flatpak users, with Flathub.

An independent project
Flatpak is developed by an independent community, with no lock-in to a single vendor.

应用开发者的新世界
Flatpak 改善了应用程序的分发。其优点包括:
为每个发行版构建
创建一个应用程序,并将其分发给整个 Linux 桌面市场。
稳定平台
运行时提供您可依赖的通用库平台。
一致的开发环境
在与用户相同的环境中开发和测试您的应用程序。
完全控制依赖关系
Flatpak 使得将您自己的库作为应用程序的一部分进行打包变得简单。
简便的构建工具
Flatpak 的构建工具简单易用,并附有完整的文档集。
面向未来的构建
Flatpak 应用程序与新版 Linux 发行版保持兼容。
分发变得简单
通过 Flathub,让您的应用程序对迅速增长的 Flatpak 用户群体可用。
一个独立的项目
Flatpak 由一个独立的社区开发,没有任何单一供应商的锁定。

TigerVNC简介

[https://gitcode.com/TigerVNC/tigervnc/overview]
High performance, multi-platform VNC client and server.
Virtual Network Computing (VNC) is a remote display system which allows you to view and interact with a virtual desktop environment that is running on another computer on the network. Using VNC, you can run graphical applications on a remote machine and send only the display from these applications to your local machine. VNC is platform-independent and supports a wide variety of operating systems and architectures as both servers and clients.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code bases. TigerVNC started as a next-generation development effort for TightVNC on Unix and Linux platforms, but it split from its parent project in early 2009 so that TightVNC could focus on Windows platforms. TigerVNC supports a variant of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo JPEG codec.

高性能的多平台 VNC 客户端和服务器。
虚拟网络计算(VNC)是一个远程显示系统,它允许您查看和与网络上另一台计算机上运行的虚拟桌面环境进行交互。使用 VNC,您可以在远程机器上运行图形应用程序,并将这些应用程序的显示只发送到您的本地机器。VNC 与平台无关,并且支持多种操作系统和架构作为服务器和客户端。
TigerVNC 是基于 RealVNC 4 和 X.org 代码库的 VNC 的高速度版本。TigerVNC 最初是 TightVNC 在 Unix 和 Linux 平台上的下一代开发工作,但在 2009 年初从其父项目中分离出来,以便 TightVNC 可以专注于 Windows 平台。TigerVNC 支持一种 Tight 编码的变体,通过使用 libjpeg-turbo JPEG 编解码器大幅加速。

在arm64的linux设备运行qgroundcontrol的难点

[https://github.com/matthewoots/qgroundcontrol/releases/tag/v4.0.0]
[https://discuss.ardupilot.org/t/how-to-cross-compile-qgroundcontrol-for-raspberry-pi3/26790/42]
[https://github.com/sidharthmohannair/Installing-QGroundControl-on-Ubuntu-ARM64-using-Flatpak]
[https://blog.csdn.net/tingwods/article/details/136684397]
[https://thopiekar.eu/uav/qgroundcontrol-on-flatpak/]
[https://github.com/mavlink/qgroundcontrol/issues/10651]
[https://github.com/flathub/org.mavlink.qgroundcontrol]
[https://blog.csdn.net/weixin_44408364/article/details/134766626]
[https://github.com/thopiekar/qgroundcontrol]
[https://docs.flatpak.org/en/latest/repositories.html]
[https://github.com/flathub/org.mavlink.qgroundcontrol/tree/master]
[https://docs.flatpak.org/en/latest/usb-drives.html]

官网的AppImage可执行文件在orangepi不显示界面,安卓apk使用waydroid在ubuntu 20.04不好配置,OpenFDE需要ubuntu22.04 版本,而直接编译qgc需要配置大量环境依赖.

The provided solution has been tested and verified on Raspberry Pi 4, Raspberry Pi 3, Ubuntu 16.04, 18.04, and 20.04, as well as Nvidia Jetson Nano ARM64 series hardware.
Note that the directories

'/var/lib/flatpak/exports/share'
'/home/orangepi/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

实现

  1. 配置vnc远程桌面
sudo apt install -y xfce4 xfce4-goodies
sudo apt install -y tigervnc-standalone-server
vncpasswd
# orangepi
sudo apt install -y vim
vim ~/.vnc/xstartup
sudo apt install -y net-tools
touch ~/start_vncserver.sh
echo -e 'vncserver -kill :1 \n vncserver :1 -localhost no -geometry 1280x720 -depth 24 \n vncserver -list' > ~/start_vncserver.sh
cat ~/start_vncserver.sh
chmod +x ~/start_vncserver.sh
~/start_vncserver.sh

xstartup

#!/bin/sh

unset SESSION_MANAGER

unset DBUS_SESSION_BUS_ADDRESS

exec startxfce4

vnc访问[192.168.255.191:5901],输入密码:orangepi

  1. 通过flatpak安装arm64架构的qgroundcontrol
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install -y flatpak
export https_proxy=http://192.168.43.18:7890 http_proxy=http://192.168.43.18:7890 all_proxy=socks5://192.168.43.18:7890
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# vnc桌面会提示输入密码
sudo flatpak remote-add --if-not-exists thopiekar.eu https://dl.thopiekar.eu/flatpak/_.flatpakrepo
# vnc桌面会提示输入密码
# sudo flatpak install flathub org.kde.Platform/aarch64/5.15-21.08
# vnc桌面会提示输入密码
# sudo flatpak install thopiekar.eu org.mavlink.qgroundcontrol
sudo flatpak -y install flathub org.mavlink.qgroundcontrol
  1. 启动
# 连接到vnc桌面
flatpak run --device=all org.mavlink.qgroundcontrol

docker版本(未测试)

docker run -it --network=bridge ubuntu:focal
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
apt update
lscpu
apt install -y wget
wget http://fishros.com/install -O fishros && bash fishros
apt-get install -y software-properties-common
add-apt-repository ppa:alexlarsson/flatpak
apt update
apt install -y flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# vnc桌面会提示输入密码
flatpak remote-add --if-not-exists thopiekar.eu https://dl.thopiekar.eu/flatpak/_.flatpakrepo
# vnc桌面会提示输入密码
flatpak install flathub org.kde.Platform/aarch64/5.15-21.08
# vnc桌面会提示输入密码
rm -r ~/cache/flatpak
flatpak -y install flathub org.mavlink.qgroundcontrol
# flatpak -y install thopiekar.eu org.mavlink.qgroundcontrol
# flatpak uninstall org.mavlink.qgroundcontrol
flatpak run --device=all org.mavlink.qgroundcontrol
# https://dl.thopiekar.eu/flatpak/repo/org.mavlink.qgroundcontrol/aarch64/master
docker commit 81cdb0d21c5c qsbye/runtime-env14:flatpak-v0.2-arm64
# 测试
docker run -it --rm qsbye/runtime-env14:flatpak-v0.2-arm64
docker push qsbye/runtime-env14:flatpak-v0.2-arm64
/root/start_vncserver.sh
# apt -y install ssh
apt install -y xfce4 xfce4-goodies
apt install -y tigervnc-standalone-server
vncpasswd
# orangepi
apt install -y vim
vim ~/.vnc/xstartup
apt install -y net-tools
touch ~/start_vncserver.sh
echo -e 'rm /tmp/.X11-unix/X3 \nrm /tmp/.X3-lock \nvncserver -kill :3 \n vncserver :3 -localhost no -geometry 1280x720 -depth 24 \n vncserver -list' > ~/start_vncserver.sh
cat ~/start_vncserver.sh
chmod +x ~/start_vncserver.sh
chmod 777 /root/.vnc/xstartup
rm /tmp/.X11-unix/X3
rm /tmp/.X3-lock
~/start_vncserver.sh

下载:

docker pull qsbye/runtime-env14:flatpak-v0.2-arm64

效果

运行截图 运行截图2 安装过程
posted @ 2024-05-03 00:19  qsBye  阅读(126)  评论(0编辑  收藏  举报