-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·270 lines (224 loc) · 10.6 KB
/
install.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#!/bin/bash
CURRENT_DIR=$PWD
cd $(dirname $0)
MULTIVERSE_DIR=$PWD/multiverse
INSTALL_ROS=true
INSTALL_PARSER=true
INSTALL_MUJOCO=true
INSTALL_ISAACLAB=true
INSTALL_KNOWLEDGE=true
while [ -n "$1" ]; do
case "$1" in
--minimal)
echo "--minimal option passed"
shift 1
INSTALL_ROS=false
INSTALL_PARSER=false
INSTALL_KNOWLEDGE=false
INSTALL_ISAACLAB=false
break
;;
--excludes)
echo -n "--excludes option passed"
shift 1
if [ "$#" -eq 0 ]; then
echo ""
INSTALL_ROS=false
INSTALL_PARSER=false
INSTALL_MUJOCO=false
INSTALL_ISAACLAB=false
INSTALL_KNOWLEDGE=false
else
echo -n ", with value:"
for module in "$@"; do
echo -n " $module"
shift 1
if [ "$module" = "ros" ]; then
INSTALL_ROS=false
elif [ "$module" = "parser" ]; then
INSTALL_PARSER=false
elif [ "$module" = "mujoco" ]; then
INSTALL_MUJOCO=false
elif [ "$module" = "isaaclab" ]; then
INSTALL_ISAACLAB=false
elif [ "$module" = "knowledge" ]; then
INSTALL_KNOWLEDGE=false
fi
done
echo ""
fi
;;
*)
echo "Option $1 not recognized"
shift 1
;;
esac
done
# Update package lists
sudo apt-get update && sudo apt-get upgrade -y
# Install presiqisite for ubuntu
sudo apt-get install -y software-properties-common curl python-is-python3 python3-pip
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y python3.10-dev python3.10-venv
UBUNTU_VERSION=$(lsb_release -rs)
if [ $INSTALL_ROS = true ]; then
if [ $UBUNTU_VERSION = "20.04" ]; then
# Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo 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 curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
sudo add-apt-repository universe
# Update package lists
sudo apt-get update && sudo apt-get upgrade -y
# Install python3.10
sudo apt-get install -y python3.10-dev python3.10-venv
# Install ROS1
sudo apt-get install -y ros-noetic-desktop-full
sudo apt-get install -y ros-noetic-xacro ros-noetic-rviz ros-noetic-joint-trajectory-controller ros-noetic-rqt-robot-steering ros-noetic-rqt-joint-trajectory-controller ros-noetic-joint-state-controller ros-noetic-joint-state-publisher-gui ros-noetic-velocity-controllers ros-noetic-effort-controllers ros-noetic-gripper-action-controller ros-noetic-dwa-local-planner ros-noetic-cob-gazebo-objects ros-noetic-map-server ros-noetic-move-base
sudo apt-get install -y python3-catkin-tools
# Install ROS2
sudo apt-get install -y ros-foxy-desktop
sudo apt-get install -y ros-foxy-joint-state-publisher-gui
sudo apt-get install -y ros-dev-tools
# Install rosdep
sudo apt-get install -y python3-rosdep
sudo rosdep init
sudo rosdep fix-permissions
rosdep update
PYTHON_EXECUTABLE=python3.8
for virtualenvwrapper in $(which virtualenvwrapper.sh) /usr/share/virtualenvwrapper/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh /home/$USER/.local/bin/virtualenvwrapper.sh; do
if [ -f $virtualenvwrapper ]; then
break
fi
done
if [ ! -f $virtualenvwrapper ]; then
echo "virtualenvwrapper.sh not found"
else
. $virtualenvwrapper
mkvirtualenv --system-site-packages multiverse3.8 -p $PYTHON_EXECUTABLE
$PYTHON_EXECUTABLE -m pip install -U pip build setuptools packaging distro
fi
elif [ $UBUNTU_VERSION = "22.04" ]; then
# Setup your sources.list
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
sudo 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
# Update package lists
sudo apt-get update && sudo apt-get upgrade -y
# Install ROS2
sudo apt-get install -y ros-humble-desktop
sudo apt-get install -y ros-dev-tools
# Install rosdep
sudo apt-get install -y python3-rosdep
sudo rosdep init
sudo rosdep fix-permissions
rosdep update
elif [ $UBUNTU_VERSION = "24.04" ]; then
# Setup your sources.list
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
sudo 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
# Update package lists
sudo apt-get update && sudo apt-get upgrade -y
# Install ROS2
sudo apt-get install -y ros-jazzy-desktop
sudo apt-get install -y ros-dev-tools
# Install rosdep
sudo apt-get install -y python3-rosdep
sudo rosdep init
sudo rosdep fix-permissions
rosdep update
PYTHON_EXECUTABLE=python3.12
for virtualenvwrapper in $(which virtualenvwrapper.sh) /usr/share/virtualenvwrapper/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh /home/$USER/.local/bin/virtualenvwrapper.sh; do
if [ -f $virtualenvwrapper ]; then
break
fi
done
if [ ! -f $virtualenvwrapper ]; then
echo "virtualenvwrapper.sh not found"
else
. $virtualenvwrapper
mkvirtualenv --system-site-packages multiverse3.12 -p $PYTHON_EXECUTABLE
$PYTHON_EXECUTABLE -m pip install -U pip build setuptools packaging distro
$PYTHON_EXECUTABLE -m pip install -U urdf_parser_py
fi
fi
fi
# Install jsoncpp
sudo apt-get install -y libjsoncpp-dev
# Install zmqpp
sudo apt-get install -y libzmq3-dev
# Install boost
sudo apt-get install -y libboost-dev libboost-filesystem-dev
# Install pybind11
sudo apt-get install -y pybind11-dev
if [ $UBUNTU_VERSION = "20.04" ]; then
# Install and link clang-11 for creating shared library
sudo apt-get install -y clang-11 llvm-11-dev libc++-11-dev libc++abi-11-dev libstdc++-11-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so
# Install and link gcc-11
sudo apt-get install -y gcc-11
# Install and link gcc+11
sudo apt-get install -y g++-11
# Upgrade pip
pip install -U pip
# Setup virtual environment
pip install virtualenvwrapper
elif [ $UBUNTU_VERSION = "22.04" ]; then
# Install and link clang-14 for creating shared library
sudo apt-get install -y clang-14 llvm-14-dev libc++-14-dev libc++abi-14-dev libstdc++-12-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so
# Setup virtual environment
python3 -m pip install virtualenvwrapper
elif [ $UBUNTU_VERSION = "24.04" ]; then
# Install and link clang-17 for creating shared library
sudo apt-get install -y clang-17 llvm-17-dev libc++-17-dev libc++abi-17-dev libstdc++-14-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so
# Setup virtual environment
python3 -m pip install virtualenvwrapper --break-system-packages
fi
PYTHON_EXECUTABLE=python3.10
# Setup virtual environment
for virtualenvwrapper in $(which virtualenvwrapper.sh) /usr/share/virtualenvwrapper/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh /home/$USER/.local/bin/virtualenvwrapper.sh; do
if [ -f $virtualenvwrapper ]; then
break
fi
done
if [ ! -f $virtualenvwrapper ]; then
echo "virtualenvwrapper.sh not found"
else
. $virtualenvwrapper
mkvirtualenv --system-site-packages multiverse -p $PYTHON_EXECUTABLE
# Install and upgrade pip build setuptools packaging distro
$PYTHON_EXECUTABLE -m pip install -U pip build setuptools packaging distro
if [ $INSTALL_PARSER = true ]; then
git submodule update --init multiverse/modules/multiverse_parser
# Install additional packages for blender
sudo apt-get install -y build-essential git git-lfs subversion cmake libx11-dev libxxf86vm-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev libegl-dev libwayland-dev wayland-protocols libxkbcommon-dev libdbus-1-dev linux-libc-dev
# Install additional packages for USD
sudo apt-get install -y libxcb-cursor0
$PYTHON_EXECUTABLE -m pip install -r $MULTIVERSE_DIR/modules/multiverse_parser/requirements.txt
fi
if [ $INSTALL_KNOWLEDGE = true ]; then
git submodule update --init multiverse/modules/multiverse_knowledge
(
cd $MULTIVERSE_DIR/modules/multiverse_knowledge
git submodule update --init ease_lexical_resources
)
# Install additional packages for multiverse_knowledge
sudo apt-get install -y libfmt-dev
$PYTHON_EXECUTABLE -m pip install -r $MULTIVERSE_DIR/modules/multiverse_knowledge/requirements.txt
fi
if [ $INSTALL_MUJOCO = true ]; then
# Install additional packages for MuJoCo
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libxt-dev
# Install glfw3
sudo apt-get install -y libglfw3
sudo apt-get install -y libglfw3-dev
$PYTHON_EXECUTABLE -m pip install -r $MULTIVERSE_DIR/modules/multiverse_connectors/src/multiverse_simulators/src/mujoco_connector/requirements.txt
fi
if [ $INSTALL_ISAACLAB = true ] && [ $UBUNTU_VERSION != "20.04" ]; then
$PYTHON_EXECUTABLE -m pip install -r $MULTIVERSE_DIR/modules/multiverse_connectors/src/multiverse_simulators/src/isaac_sim_connector/requirements.txt
fi
fi