-
Notifications
You must be signed in to change notification settings - Fork 37
/
install2.sh
81 lines (64 loc) · 2.22 KB
/
install2.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
#!/bin/bash -i
branch=${1:-master}
set -e
# Store the current working directory
current_dir="$(pwd)"
# Check if Folder Empty
if [[ -d ~/arena_ws/src/arena ]]; then
echo "Install Folder ~/arena_ws/src/arena/arena-rosnav already exists."
echo "This indicates Arena Rosnav is already installed."
echo "If you wish to reinstall, please delete ~/arena_ws"
exit 1
fi
sudo echo ""
# Project Setup
echo "Preparing Project...:"
mkdir -p ~/arena_ws
cd ~/arena_ws
# clone arena-rosnav
git clone --branch ${branch} https://github.com/Arena-Rosnav/arena-rosnav.git src/arena/arena-rosnav
until vcs import src < src/arena/arena-rosnav/.repos ; do echo "failed to update, retrying..." ; done
#
#python env init
cd src/arena/arena-rosnav
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring # resolve faster
poetry run poetry install --no-root || (poetry run poetry lock --no-update && poetry run poetry install --no-root)
poetry env use python3.8
. "$(poetry env info -p)/bin/activate"
cd ~/arena_ws
#
# Missing Deps
echo "Installing Missing Deps...:"
sudo apt update && sudo apt install -y libopencv-dev liblua5.2-dev libarmadillo-dev ros-noetic-nlopt liblcm-dev
rosdep update && rosdep install --from-paths src --ignore-src -r -y
# Project Install
echo "Installing Project...:"
catkin build
export ROS_MASTER_URI=http://127.0.0.1:11311/
export ROS_IP=127.0.0.1
MARKER="# ARENA-ROSNAV"
SHELLS=(~/.zshrc ~/.bashrc)
# add to .<shell>rc if exists
for SHELL in "${SHELLS[@]}"
do
if [ -e "$SHELL" ]; then
if ! grep -q "$MARKER" "$SHELL"; then
echo "Adding to $SHELL"
echo '' >> "$SHELL"
echo "$MARKER" >> "$SHELL"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$SHELL"
# echo '. "$(cd src/arena/arena-rosnav && poetry env info -p)/bin/activate"' >> "$SHELL"
echo 'source $HOME/arena_ws/devel/setup.bash' >> "$SHELL"
echo '' >> "$SHELL"
fi
fi
done
# Return to the original working directory
cd "$current_dir"
echo ""
echo "Installation Complete."
echo "You can confirm that it works, by running the following command in a NEW terminal:"
echo ""
echo "roslaunch arena_bringup start_arena.launch"
echo ""
echo "If you need to train or use rosnav/aio planners, download and run install3_training.sh."