-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·81 lines (62 loc) · 1.49 KB
/
setup.sh
File metadata and controls
executable file
·81 lines (62 loc) · 1.49 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -e
if [ "$(id -u)" == "0" ] && [ -z "$SUDO_USER" ]; then
echo "Don't run as root."
exit -1
fi
# ensure root permissions
if [ "$(id -u)" != "0" ]; then
exec sudo "$0" "$@"
fi
apt update
apt upgrade -y
apt install -y \
curl \
fish \
vim \
neovim \
git \
nodejs \
build-essential \
cmake \
htop \
openssh-server \
clang \
python \
python3 \
silversearcher-ag \
nodejs \
npm \
python3-pip
pip install \
numba==0.54.0
numpy==1.20.3
if [ ! -e /opt/ros/noetic/ ]; then
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
apt update
apt install ros-noetic-desktop-full
source /opt/ros/noetic/setup.bash
sudo apt install -y python3-rosdep
fi
if [ ! -e /etc/ros/rosdep/sources.list.d/20-default.list ]; then
rosdep init
fi
# post ros install
sudo apt install -y \
python3-rosdep \
python3-catkin-tools \
ros-noetic-dbw-polaris \
ros-noetic-dataspeed-ulc
echo "$SUDO_USER"
sudo -u $SUDO_USER bash << EOF
set -e
rosdep update
if ! grep -Fq "/opt/ros" "/home/${SUDO_USER}/.bashrc"; then
echo 'adding line to bashrc'
echo 'source /opt/ros/noetic/setup.bash' >> "/home/${SUDO_USER}/.bashrc"
echo 'added'
fi
EOF
sudo apt install -y python-is-python3
echo "Setup complete. Please close this terminal and open a new one."