How to compile QGC-herelink

Is there a guide available on how to set up the build environment and compile CubePilot/qgroundcontrol-herelink?

The Readme on Github only generally lists 3 components, that you need, but not how to install and set up everything. I installed QtCreator and Qt5.11.0, but had no idea which modules to select while installing and some are probably missing, whioch is why I probably get a lot of errors. Also what do I do with the Android NDK folder, that I downloaded? Can anyone help me out, which modules to select exactly and generally how to set up the build environment?

Just as an example for Arducopter there are detailed instructions on how to compile/build it. I am looking for something similar.

1 Like

It should be same as ordinary QGC
https://dev.qgroundcontrol.com/master/en/getting_started/index.html

I can build regular QGC, but not the herelink version. I tried it on windows and ubuntu, but get the following error (on windows it´s the same):

:-1: error: Project ERROR: Cannot run target compiler '/home/david/Android/Sdk/ndk/21.3.6528147/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++'. Output:
===================
/bin/sh: 1: /home/david/Android/Sdk/ndk/21.3.6528147/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++: not found
===================
Maybe you forgot to setup the environment?

I don´t know why the error is about the default ndk even though I set up NKD15 as described in the readme.md. Here is my kit:

edit. Btw. the Qt website mentions, that we should use NDK r10e with Qt5.11 and earlier. I´m a bit confused.

Finally I did manage to build the code. I had to set the ANDROID_NDK_ROOT build environemnt variable to the NDK 15 location on my disk. And even so there was a problem, where QtCreator expected a folder to be named windows, but it was windows-x86_64.

Now I just have to figure out QML programming and how to actually test it (how do I put it onto my Herelink???). This is the worst documented “open source” project I had to work on. Also why are there so few commits on GitHub? Where is the beta development going on? Or has QGC-herelink been converted to closed source?

You should generate an apk file and install it to Herelink as mentioned in docs.cubepilot
https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/installing-a-custom-app

Note that you have to disable the stock QGC in Herelink so that 2 QGC won’t conflict.

The beta changes are not public. We release them when they become stable.

That didnt work, because you cant uninstall the default QGC. I managed to write a script, that flashes an img via fastboot according to this page: OEM Image Setup - CubePilot

What I am trying to do is to control a Flir Duo Pro R from on screen buttons/switches, because all my hardware switches are already in use. I have successfully created a UI with an extra page in the flight map widgets in a qml file and the next step is to actually make the buttons do something. I need to send a few mavlink commands (basically move some servos with MAV_CMD_DO_SET_SERVO) and I am not sure how to do this yet. I probably need to create some c++ functions, that send the mavlink commands. Any help would be appreciated.

You can’t uninstall the default QGC. You have to disable it

For buttons, try mavlink buttons:
https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/mavlink_buttons#to-configure-in-qgc

I don´t have anymore hardware buttons available (used them all for other functions) and that´s why I need on-screen buttons. It would be greatly appreciated if you could help me with how to call the function “Q_INVOKABLE void sendCommand(…)” in Vehicle.h from qml. I tried the following, but didn´t work:

import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0

property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle

QGroundControl.vehicle.sendCommand(_activeVehicle,   //Component to send to
                                   183,              //MAV_CMD to send 183:MAV_CMD_DO_SET_SERVO
                                   true,             //showError
                                   7,                //servo instance
                                   1500)             //servo value in us

I get the error “TypeError: Cannot call method ‘sendCommand’ of undefined” in the QGC console.