This repository was archived by the owner on Jun 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·50 lines (41 loc) · 1.41 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# This script sets up the environment for the project
# Tested on Ubuntu 22.04
set -e
echo "Setting up the environment..."
# Install system dependencies
echo "-- Installing system dependencies..."
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
python3 \
python3-pip \
libgrpc++-dev \
libprotobuf-dev \
protobuf-compiler-grpc
# Clone MAVLink repository
if [ ! -d "mavlink" ]; then
echo "-- Cloning mavlink repository..."
git clone https://github.com/mavlink/mavlink.git --recursive
else
echo "-- Mavlink repository already exists, skipping clone."
fi
cd mavlink
# Ensure submodules are initialized and updated
echo "-- Initializing and updating submodules..."
git submodule update --init --recursive
# Generate MAVLink headers
echo "-- Generating MAVLink headers..."
python3 -m pip install -r pymavlink/requirements.txt
python3 -m pymavlink.tools.mavgen --lang=C --wire-protocol=2.0 --output=generated/include/mavlink/v2.0 message_definitions/v1.0/common.xml
# run CMake for installing headers
echo "-- Running CMake to install headers..."
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=install -DMAVLINK_DIALECT=common -DMAVLINK_VERSION=2.0
cmake --build build --target install
# Return to the original directory
cd ..
echo "-- Installing Python dependencies for the generator..."
pip3 install -r generator/requirements.txt
echo "Environment setup complete."