Building from sources
Where to get the code¶
Navio2 is supported in the upstream ArduPilot repository.
How to build¶
ArduPilot binary for can be built using two ways:
1) Directly on your Raspberry Pi. Simpler, but slower. Build takes approximately 15 minutes.
2) Using a cross-compiler (on Linux PC or virtual machine). This is much faster, but requires one-time setup.
If you'd like to build on Raspberry Pi skip the next step.
Cross-compiler setup on Linux (optional)¶
Recommended compiler is the one that is provided by Raspberry Pi Foundation. Download and extract it somewhere, for example in /opt/:
sudo git clone --depth 1 https://github.com/raspberrypi/tools.git /opt/tools
If you're using 32-bit distro add the following to your PATH:
For 64-bit distro add this to your PATH
If you would like to add the compiler to the PATH permanently edit /etc/environment.
Building ArduPilot using Waf build system¶
These steps are the same both for compiling ArduPilot directly on Raspberry Pi and cross-compiling.
Download the ArduPilot code and update submodules:
git clone https://github.com/ArduPilot/ardupilot.git cd ardupilot git submodule update --init --recursive
Checkout to a specific tag in order not to fly off master.
git tag to get a list of tags
For example, to build a copter binary:
git checkout ArduCopter-stable or git checkout ArduCopter-beta
Note that Waf should always be called from the ardupilot's root directory.
To keep access to Waf convenient, use the following alias from the root ardupilot directory:
Differently from the make-based build, with Waf there's a configure step to choose the board to be used:
waf configure --board=navio2
future isn't installed then you should install it:
pip install future
Now you can build arducopter. For a copter use the following command:
In the end of compilation binaries with the name like
arducopter-quad will be placed in
We suggest checking out ArduPilot docs for further details here. This is the most up-to-date reference.
If you're using cross-compiler transfer the binary to your Raspberry Pi:
rsync -avz ardupilot/build/navio2/bin/arducopter-quad email@example.com:/home/pi/
Where 192.168.1.3 is an IP address of your Raspberry Pi with a Navio.
Instructions how to run ArduPilot on Raspberry Pi and to connect GCS to it are available in Installation and running section.