forked from heronsystems/OpenMACE
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstallPrereqs.sh
executable file
·110 lines (92 loc) · 3.25 KB
/
installPrereqs.sh
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
usage() {
echo -n "./installPrereqs.sh [OPTION]
This is an install script for OpenMACE prerequisites. Pass in flags to choose which pieces to install.
${bold}Options:${reset}
-r, --ros Toggle install ROS flag
-h, --help Display this help and exit
"
}
installPrereqs() {
echo "************************************"
echo "Installing OpenMACE prerequisites..."
echo "************************************"
apt-get update
# Install tools here, (recommended to use multiple lines so they don't have to all reinstall if you change one)
apt-get install -y cmake
apt-get install -y nano
apt-get install -y tmux
apt-get install -y git
apt-get install -y wget
apt-get update
apt-get install -y qt5-default
# wget http://download.qt.io/official_releases/qt/5.14/5.14.0/qt-opensource-linux-x64-5.14.0.run
# chmod +x qt-opensource-linux-x64-5.14.0.run
# ./qt-opensource-linux-x64-5.14.0.run
apt-get install -y libqt5serialport5-dev
apt-get install -y build-essential
apt-get install -y libboost-system-dev
apt-get install -y python-pip
apt-get install -y python-dev
# pip install --upgrade pip
# pip install --upgrade virtualenv
# If we are installing ROS, these will be installed as dependencies of ROS packages
if [ "$installROS" != "1" ]; then
apt-get update
apt-get install -y pkg-config
apt-get install -y liblz4-dev
fi
apt-get install -y apt-transport-https
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt install -y nodejs
apt remove -y cmdtest
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y yarn
}
installROS() {
echo "************************************"
echo "Installing ROS..."
echo "************************************"
echo "Enter your ROS version:"
read rosVersion
# May not need this first apt-get update...
apt-get update
apt-get install -y lsb-release
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
apt-get install -y ros-${rosVersion}-desktop-full
rosdep init
rosdep update
echo "source /opt/ros/${rosVersion}/setup.bash" >> ~/.bashrc
source ~/.bashrc
apt-get install -y python-rosinstall
apt-get install -y python-rosinstall-generator
apt-get install -y python-wstool
apt-get install -y ros-${rosVersion}-octomap*
apt-get install -y ros-${rosVersion}-tf*
apt-get install -y python-rospkg
# pip install rospkg
}
#### MAIN
installROS=
while [ "$1" != "" ]; do
case $1 in
-r | --ros ) installROS=1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
# If toggled, install prerequisites
installPrereqs
# If toggled, install ROS
if [ "$installROS" = "1" ]; then
installROS
fi