2.7 KiB
Azaion Autopilot
A preliminary example of autonomous drone flight. This example is based on the MAVSDK framework and ArduPilot flight controller software. Running the example requires installing MAVSDK debian package and compiling ArduPilot. Example has been tested in Ubuntu 20.04 environment.
Install necessary dependencies
sudo apt update
sudo apt install ccache git build-essential qt5-qmake qtbase5-dev
Speed up the compilations
echo "export MAKEFLAGS="-j$(($(nproc)))"" >> ~/.bashrc
echo "export PATH=/usr/lib/ccache:$PATH" >> ~/.bashrc
Clone source codes. You must add your SSH key before the cloning!
git clone git@github.com:azaion/autopilot.git git clone --recursive git@github.com:azaion/autopilot.git git submodule update --init --recursive
Install MAVSDK for Ubuntu 20.04
wget https://github.com/mavlink/MAVSDK/releases/download/v2.9.1/libmavsdk-dev_2.9.1_ubuntu20.04_amd64.deb
sudo dpkg -i libmavsdk-dev_2.9.1_ubuntu20.04_amd64.deb
Install MAVSDK for Ubuntu 22.04
wget https://github.com/mavlink/MAVSDK/releases/download/v2.9.1/libmavsdk-dev_2.9.1_ubuntu22.04_amd64.deb
sudo dpkg -i libmavsdk-dev_2.9.1_ubuntu22.04_amd64.deb
Install MAVSDK for embedded platforms
Update cmake (need to build mavsdk)
wget https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-aarch64.sh sudo cp cmake-3.29.3-linux-aarch64.sh /opt sudo chmod +x /opt/cmake-3.29.3-linux-aarch64.sh cd /opt sudo bash cmake-3.29.3-linux-aarch64.sh sudo rm cmake ccmake cpack ctest cmake-gui sudo ln -s /opt/cmake-3.29.3-linux-aarch64/bin/* /usr/bin
Make sure gcc9 installed and is default (Need to build mavsdk. gcc -v to check)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gcc-9 g++-9 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
Build & Install from sources
sudo apt-get update sudo apt-get install build-essential cmake git git clone https://github.com/mavlink/MAVSDK.git cd MAVSDK git submodule update --init --recursive cmake -Bbuild/default -DCMAKE_BUILD_TYPE=Release -H. cmake --build build/default -j8 sudo cmake --build build/default --target install
Resolving python problems
In case of an error "The python version is too old, expecting 3, 6, 9" during Ardupilot run, install 3.6 python (most probably under alias python3) and just change 1 line in ardupilot/modules/waf/waf-light from ... python -> python3
Build autopilot application
cd src && cmake . && make
Launch similator in the ArduPilot directory
./Tools/autotest/sim_vehicle.py --map --console -v ArduCopter
Launch example application in the new terminal window after waiting simulator (around 1 min) to be ready
cmake . && make && ./autopilot mission.json