From 03de7ea327dc78ea85b5ea975662272e3301fef0 Mon Sep 17 00:00:00 2001 From: Alex Bezdieniezhnykh Date: Sun, 19 May 2024 23:39:59 +0300 Subject: [PATCH] add instructions on building and running on jetson/any embedded --- README.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d37eb18..78399d9 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,44 @@ wget https://github.com/mavlink/MAVSDK/releases/download/v2.9.1/libmavsdk-dev_2. 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 && qmake && make +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 -qmake && make && ./autopilot mission.json +cmake . && make && ./autopilot mission.json