-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (32 loc) · 1.27 KB
/
setup.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1.27 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
#!/bin/bash
# Set to exit on error
set -e
read -p 'Team number: ' TEAM_NUMBER
if ! [[ "$TEAM_NUMBER" =~ ^[0-9]+$ ]]
then
echo "Please enter integer for team number"
fi
TEAM_NUMBER=$((TEAM_NUMBER))
# Constants to be updated
ROS_VERSION=jazzy
# Update and upgrade
sudo apt install -y software-properties-common
sudo add-apt-repository universe -y
sudo apt update && sudo apt upgrade -y
# Install build-essential
sudo apt install -y build-essential
# install Git
sudo apt install -y git
# Setup ROS 2 and dependencies
sudo apt install -y curl
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt install -y ros-$ROS_VERSION-desktop python3-rosdep python3-colcon-common-extensions python3-pip
sudo rosdep init
rosdep update
echo "export ROS_DOMAIN_ID=$TEAM_NUMBER" >> ~/.bashrc
echo "source /opt/ros/$ROS_VERSION/setup.bash" >> ~/.bashrc
echo "export PIP_BREAK_SYSTEM_PACKAGES=1" >> ~/.bashrc
source ~/.bashrc
echo "Installation finished!"