Skip to content

Commit 1af691b

Browse files
micstinsomikeulus
authored andcommitted
Splitting mavsdk from ardupilot for containerization
1 parent 898c1a5 commit 1af691b

2 files changed

Lines changed: 47 additions & 50 deletions

File tree

mavlinkinstall.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
#update/upgrade the system
6+
sudo apt update && sudo apt upgrade -y
7+
wait
8+
echo "Sys update/upgrade done"
9+
10+
# install build tools
11+
sudo apt-get install build-essential cmake git zip unzip python3-pip -y
12+
wait
13+
echo "pre-req tools installed"
14+
15+
# Clone MAVSDK
16+
cd ..
17+
git clone https://github.com/mavlink/MAVSDK.git
18+
wait
19+
echo "MAVSDK cloned"
20+
21+
cd MAVSDK
22+
git submodule update --init --recursive
23+
wait
24+
echo "MAVSDK submodules updated"
25+
26+
# Build MAVSDK, including Server
27+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -Bbuild -S.
28+
wait
29+
echo "MAVSDK build config"
30+
31+
cmake --build build -j8
32+
wait
33+
echo "MAVSDK built"
34+
35+
# Install MAVSDK, including Server
36+
sudo cmake --build build --target install
37+
wait
38+
echo "MAVSDK installed"
39+
40+
# Update LDCONFIG
41+
sudo ldconfig
42+
wait
43+
echo "ldconfig updated"
44+

osh_drone_install.sh

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,11 @@ sudo apt update && sudo apt upgrade -y
77
wait
88
echo "Sys update/upgrade done"
99

10-
# set up adoptium
11-
sudo apt install -y wget apt-transport-https
12-
wait
13-
echo "apt-transport-https installed"
14-
15-
sudo wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
16-
17-
sudo echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
18-
wait
19-
echo "Added adoptium to sources list"
20-
21-
#update again to get adoptium repo
22-
sudo apt update
23-
wait
24-
echo "Updated to get adoptium"
25-
26-
echo "setting JAVA_HOME"
27-
echo "export JAVA_HOME=$(realpath $(dirname $(readlink -f $(which java)))/../)" >> ~/.bashrc
28-
2910
# install build tools
30-
sudo apt-get install build-essential cmake git zip unzip python3-pip temurin-17-jdk temurin-21-jdk -y
11+
sudo apt-get install build-essential cmake git zip unzip python3-pip -y
3112
wait
3213
echo "pre-req tools installed"
3314

34-
# Clone MAVSDK
35-
cd ..
36-
git clone https://github.com/mavlink/MAVSDK.git
37-
wait
38-
echo "MAVSDK cloned"
39-
40-
cd MAVSDK
41-
git submodule update --init --recursive
42-
wait
43-
echo "MAVSDK submodules updated"
44-
45-
# Build MAVSDK, including Server
46-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -Bbuild -S.
47-
wait
48-
echo "MAVSDK build config"
49-
50-
cmake --build build -j8
51-
wait
52-
echo "MAVSDK built"
53-
54-
# Install MAVSDK, including Server
55-
sudo cmake --build build --target install
56-
wait
57-
echo "MAVSDK installed"
58-
59-
# Update LDCONFIG
60-
sudo ldconfig
61-
wait
62-
echo "ldconfig updated"
63-
6415
# Clone Ardupilot
6516
cd ..
6617
git clone https://github.com/ArduPilot/ardupilot.git
@@ -80,6 +31,8 @@ echo "path reloaded"
8031

8132
# Add Taiwan as pre-defined location in Ardupilot
8233
echo "Taiwan=24.178772,120.649633,0,0" >> Tools/autotest/locations.txt
34+
echo "Taiwan2=24.178772,120.648633,0,0" >> Tools/autotest/locations.txt
35+
echo "Taiwan3=24.178772,120.647633,0,0" >> Tools/autotest/locations.txt
8336
wait
8437
echo "Taiwan added as location to Ardupilot"
8538

0 commit comments

Comments
 (0)