Building APM planner for Debian Buster

Version0.1

APM Planner 2.0 is an open-source ground station application for MAVlink based autopilots including APM and PX4/Pixhawk that can be run on Windows, Mac OSX, and Linux.

As the ardupilot team do not provide binaries for Debian 10, code name Buster, in this post I’m going to follow up the instructions to build from source code the APM planner for Linux Debian Buster OS with amd64 architecture. You should start to follow the instructions from the github repository and when you stuck, read the additional steps in my post, because I don’t want to repeat all over.

Maybe you will have additional issues, then if you can’t find the solution you can ask in the comments for help and I’ll do my best to support you.

(!) - Before start go through the document till the end, I did not consolidate the instructions yet!
(!) - Install all the dependencies mentioned in here

Follow the documentation and fix the issues

Follow the instructions at:

https://ardupilot.org/planner2/docs/installation-for-linux.html

Where the source code is here:

https://github.com/ArduPilot/apm_planner

Observations

By default Debian Buster do not install sudo, instead using the following to replace it is go to go:

jenkins@debian-faisca:~/workspace/apm_planner$ su
Password:

Step #1 – Install dependencies

Issue:

root@debian-faisca:/home/jenkins# apt install qtdeclarative5-qtquick2-plugin
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package qtdeclarative5-qtquick2-plugin

Solution:

Package qtdeclarative5-qtquick2-plugin is not available but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source.
However, the following packages replace it: qml-module-qtquick2, so executing the following should fix it:

root@debian-faisca:/home/jenkins#apt install qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick2

Step #2 – Build APM Planner

Issue:

jenkins@debian-faisca:~/workspace/apm_planner$ qmake apm_planner.pro
Project ERROR: Cannot run compiler 'g++'. Output:
===================
sh: 1: g++: not found
===================
Maybe you forgot to setup the environment?

Solution:

Development tools are not installed

root@debian-faisca:/home/jenkins/workspace/apm_planner# apt install build-essential

After the check g++

root@debian-faisca:/home/jenkins/workspace/apm_planner# g++ --version
g++ (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Now get back to qmake! this time without root previliegues, but first need to remove the temporary folders and files created by qmake, after some try and error 🙂

root@debian-faisca:/home/jenkins/workspace/apm_planner# rm build-release config.log .qmake.stash release
rm: cannot remove 'build-release': Is a directory
rm: cannot remove 'release': Is a directory
root@debian-faisca:/home/jenkins/workspace/apm_planner# rm -r build-release config.log .qmake.stash release
rm: cannot remove 'config.log': No such file or directory
rm: cannot remove '.qmake.stash': No such file or directory

And the final output of qmake is:

Info: creating cache file /home/jenkins/workspace/apm_planner/.qmake.cache
cat: /etc/redhat-release: No such file or directory
Checking for has_flite... no
Project MESSAGE: Linux build x86
Project MESSAGE: Release flavor
Project MESSAGE: BASEDIR /home/jenkins/workspace/apm_planner DESTDIR /home/jenkins/workspace/apm_planner/release TARGET apmplanner2
Project MESSAGE: Using MAVLink dialect 'ardupilotmega'.
Project MESSAGE: Skipping support for Google Earth
Project MESSAGE: Skipping support for libfreenect
Project MESSAGE: Adding ALGLIB /home/jenkins/workspace/apm_planner/libs/alglib
Project MESSAGE: Skipping support for XBee
Project MESSAGE: Skipping support for Magellan 3DxWare (manual override from command line)
Project MESSAGE: Skipping support for Opal-RT
Project MESSAGE: Skipping support for Google Earth
Project MESSAGE: Skipping support for Camera View
Empty filename passed to function
Empty filename passed to function
Empty filename passed to function

No error, then it looks fine, this is the buity of Qt, a cross-platform helper command that creates the makefile for you.

!UPDATE! On the new VM with Debian Buster amd64 I got the following errors:

Issue:

 Unknown module(s) in QT: svg serialport quick qml quickwidget                                   s

Fix:

To test if X11 is working, install X11 Apps and test Xclock

root@lukidrone:/home/lukidrone/workspace/apm_planner# apt install x11-apps
lukidrone@lukidrone:~/workspace/apm_planner$ xclock

If you see a clock move the next step

The root cause is that I forgot to install Qt Development packages, so I recommend to run:

root@lukidrone:/#apt install qtdeclarative5-dev
root@lukidrone:/#apt install qtcreator

Additional fix for svg and serialport qt modules:

root@lukidrone:/#apt install libqt5svg5* libqt5serialport5-dev

Hooray!!!

Klassenerhalt ist geschafft ! - News - Tornado Flanning e.V - geomix  Vereinshomepage
lukidrone@lukidrone:~/workspace/apm_planner$ qmake apm_planner.pro
Project MESSAGE: Qt version 5.11.3
cat: /etc/redhat-release: No such file or directory
Project MESSAGE: Linux build x86
Project MESSAGE: Release flavor
Project MESSAGE: BASEDIR /home/lukidrone/workspace/apm_planner DESTDIR /home/lukidrone/workspace/apm_planner/release TARGET apmplanner2
Project MESSAGE: Using MAVLink dialect 'ardupilotmega'.
Project MESSAGE: Skipping support for Google Earth
Project MESSAGE: Skipping support for libfreenect
Project MESSAGE: Adding ALGLIB /home/lukidrone/workspace/apm_planner/libs/alglib
Project MESSAGE: Skipping support for XBee
Project MESSAGE: Skipping support for Magellan 3DxWare (manual override from command line)
Project MESSAGE: Skipping support for Opal-RT
Project MESSAGE: Skipping Flite Support
Project MESSAGE: Skipping support for Google Earth
Project MESSAGE: Skipping support for Camera View
Empty filename passed to function
Empty filename passed to function
Empty filename passed to function

Sounds good – Now MAKE it!

root@lukidrone:/#make clean
root@lukidrone:/#make
Wait…

Still some bumps on the frsh vm installation:

root@lukidrone:/#apt zlib1g-dev libsdl2-dev libsndfile-dev
Bump Warning Sign - - TreeTop Products

Another bump!

Issue:

usr/include/c++/8/bits/stl_relops.:67: Parse error at "std"

This one is FANTASTIC! one of the best issues I found on building software… woth to read the solution from Roland here: https://www.logikalsolutions.com/wordpress/information-technology/moc-parse-error-at-std/

It makes no sense, but I follow it and solve the problem.

Build and wait….

After some time the build is done, still one setting:

Adding the user that runs the application to the dialout group, again with some changes from an expected linux environment:

jenkins@debian-faisca:~/workspace/apm_planner/release$ su
Password:
root@debian-faisca:/home/jenkins/workspace/apm_planner/release# /sbin/usermod -a -G dialout jenkins
root@debian-faisca:/home/jenkins/workspace/apm_planner/release# exit

Finally, APM Planner is running on my VM:

The GUI from the master branch build

Looks great, next steps are:

  1. Build the debian package
  2. Make the debian package available for download
  3. Start testing the app with Arduino UNO

Leave a Comment

Your email address will not be published. Required fields are marked *

Building APM planner for Debian Buster

time to read: 9 min
Scroll to Top