-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·98 lines (86 loc) · 2.35 KB
/
setup.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
#!/bin/bash
set -e
export VENV_PATH="/workspace/poetry"
# Import repositories from vcs file
echo "Cloning repositories ..."
mkdir -p src
vcs import < planner.repos src --recursive
# vcs import < lab.repos src --recursive # Uncomment to clone lab packages
echo "Done cloning repositories."
# Switch to ROS1 mode
echo "Switching to ROS 1 ..."
cd src
cd mpc_planner
python3 switch_to_ros.py 1
cd ..
cd ros_tools
python3 switch_to_ros.py 1
cd ..
cd guidance_planner
python3 switch_to_ros.py 1
cd ..
cd pedestrian_simulator
python3 switch_to_ros.py 1
cd ..
cd ..
echo "Done, all repos are in ROS1 mode."
# Install Acados
if [ ! -d "/workspace/acados/build" ]; then
echo "Installing Acados ..."
git clone https://github.com/acados/acados.git
cd acados
# Specific commit (remove to change to newest version)
git checkout c48cf1135b779fb4582358da89c119f7c481dcea
git submodule update --recursive --init
mkdir -p build
cd build
cmake -DACADOS_SILENT=ON ..
make install -j4
cd ../bin
wget https://github.com/acados/tera_renderer/releases/download/v0.0.34/t_renderer-v0.0.34-linux
mv t_renderer-v0.0.34-linux t_renderer
chmod +x t_renderer
cd ../..
fi
echo "Acados is installed."
install_poetry() {
echo "Installing Poetry ..."
python3 -m pip install poetry
echo "Installed Poetry succesfully."
python3 -m poetry lock
}
echo "Checking the poetry installation"
cd src/mpc_planner
if ! python3 -m poetry lock; then
echo "Poetry is not installed."
if [[ "$1" == "-y" ]]; then
install_poetry
else
# Ask the user for confirmation
read -p "Do you want to install Poetry now? (y/n): " response
case "$response" in
[yY][eE][sS]|[yY])
install_poetry
;;
[nN][oO]|[nN])
echo "Installation aborted."
exit 0
;;
*)
echo "Invalid input. Please enter y or n."
exit 0
;;
esac
fi
fi
cd ../..
echo "Poetry is installed."
cd /workspace/src/mpc_planner
python3 -m poetry install --no-interaction --no-root
python3 -m poetry add -e /workspace/acados/interfaces/acados_template
cd ../..
echo "Done."
# Install dependencies
sudo apt-get update -y
rosdep update
rosdep install -y -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO