How To: Install APM Planner 2.0 On Raspberry Pi 2/3

Installing APM Planner on a Raspberry Pi 2 or 3.

This is a simple process if you know what you’re doing. The trick is trying to get up to date with all the forum posts and notes that have accumulated as this project has evolved. There are a lot of links in different places. I decided to put all the notes in one place so someone who is interested can get up and running faster.

Setting Up the Pi

Building and Installing APM Planner (from terminal window)

  • Add some pre-requisites (this can take hours - let it finish)
    sudo apt-get install qt5-default qtdeclarative5-dev libqt5opengl5-dev libqt5svg5-dev libqt5extserialport-dev libqt5serialport5-dev libqt5svg5-dev libqt5gstreamer-dev qtscript5-dev libsdl2-dev libsndfile1-dev libssl-dev git qtdeclarative5-qtquick2-plugin

  • Get the source from git hub:
    git clone https://github.com/diydrones/apm_planner

  • Compile the source (this can also take hours - let it run)
    cd apm_planner qmake apm_planner.pro make

  • Run it!!
    ./release/apmplanner2

1 Like

There was a version released specifically for the raspberry Pi 2 a while ago, it still works fine and can be found under the archives of previous releases, once downloaded it can just be installed using a dpkg command. I recently installed it on my Pi 2 during a ground station overhaul. I had to play with the resolution settings in the config file to get it to fit and display properly on a 7" screen but it’s usable. I also had to create a 4Gb swap file for it to install. Does this still have to be done when building from source?

Yes, not enough memory for the compiler. I’m a little surprised you needed swap for the install.

Those raspi are multi core, so you can speed up a little the compilation by using make -j2 (theoricaly -j4 but it makes lack of memory)

I was able to run the debian file available in the downloads, on Raspi 2 but I am not able to connect to the data link. which port id ttyUSB0 on the raspberry pi.

Take a look at this thread and see if that helps.
http://discuss.ardupilot.org/t/apm-planner-2-0-18-on-raspberry-pi-2-with-ubuntu-mate-15-04/6418

i was able to connect to the UAV with apm planner2 running on raspberry pi 2.
the problem was that the baud rate of ttyUSB0 was not same as that of data modem (19200 in this case). so I set the baud rate of ttyUSB0 to 19200 and bit rate to 8 using the command as given below:

stty -F /dev/ttyUSB0 19200 cs8

this has to be done every time you power the raspi. so write this command in config file which will set the baud rate to 19200 everytime you boot the raspi.

I am using the prebuilt debian file of apm planner which is in the download area of ardupilot.org
there was no other issue in running on raspberry pi.

I am getting an error when attempting to run apm planner on my Odroid XU4 with ubuntu mate. FATAL - Could not initialize OpenGL. Any suggestions?