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:

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.

1 Like

I tried to disable this tonight. It is greyed out. I am in developer mode but I feel this is a root thing. Iā€™m making a guess the port is on 14550 that is bound. What does it take paperwork wise to get this access?

The solution I found is Application Settings | Comm Links | Add | UDP on port 14551.

It was as much a guess as it was I think Iā€™ve seen 14551 floating around somewhere.

Can confirm this works and connects to a Herelink. My question now revolves around the differences between:
GitHub - mavlink/qgroundcontrol: Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)

Are there any safety of flight concerns or is it more a matter of taste, etc?

Thanks!

Is there any documentation on this? I believe that QGC herelink is using qgc 4.0.0.

The instructions on how to compile QGC 4.0.0 are no longer available.

Any insight into the build process would be appreciated

1 Like

@philip @Michael_Oborne
Apologies for the direct tag, but was hoping you could point us in the correct direction. We would be happy to produce some documentation on how QGC-herelink is compiled (for future users who would like to), but we are struggling.

We would be happy to pay for your time. Or, if there is a jenkins pipeline or anything setup that we can glean this information from we would be happy to do that.

Thank you!

1 Like

There is a GitHub ci pipeline setup in the repo, I would refer you to that

1 Like

Thank you Michael!