-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·103 lines (83 loc) · 3.69 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
#!/usr/bin/env bash
TURBO_JPEG='1.5.1'
PUPIL_RELEASE='v2.6'
PUPIL_VERSION="${PUPIL_RELEASE}-19-g6344358"
# Create a log file of the installation process as well as displaying it
exec > >(tee driver-awareness-install.log)
exec 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WS_SRC="${SCRIPT_DIR}"/..
pushd "$WS_SRC" || exit
sudo apt update && sudo apt install -y apt-utils
echo 'Install Pupil Labs'
# Pupil dependencies
sudo apt install -y pkg-config git cmake build-essential nasm wget python3-setuptools libusb-1.0-0-dev python3-dev python3-pip python3-numpy python3-scipy libglew-dev libtbb-dev
# ffmpeg >= 3.2
sudo apt install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev ffmpeg x264 x265 libportaudio2 portaudio19-dev
# OpenCV >= 3
sudo apt install -y python3-opencv libopencv-dev
# 3D Eye model dependencies
sudo apt install -y libgoogle-glog-dev libatlas-base-dev libeigen3-dev
sudo apt install -y libceres-dev
# Turbojpeg
wget -O libjpeg-turbo.tar.gz https://sourceforge.net/projects/libjpeg-turbo/files/${TURBO_JPEG}/libjpeg-turbo-${TURBO_JPEG}.tar.gz/download
tar xvzf libjpeg-turbo.tar.gz
pushd libjpeg-turbo-${TURBO_JPEG} || exit
./configure --enable-static=no --prefix=/usr/local
sudo make install
sudo ldconfig
popd || exit
sudo rm -rf libjpeg-turbo-${TURBO_JPEG} libjpeg-turbo.tar.gz
# Custom Version of libusb for 200hz cameras
wget https://github.com/pupil-labs/libusb/releases/download/v1.0.21-rc6-fixes/libusb-1.0.so.0
sudo dpkg -L libusb-1.0-0-dev | grep libusb-1.0.so
rm -rf libusb-1.0.so.0
# Libuvc
git clone https://github.com/pupil-labs/libuvc
pushd libuvc || exit
mkdir build
pushd build || exit
cmake ..
make && sudo make install
popd || exit
popd || exit
rm -rf libuvc
# Run libuvc as normal user
echo 'SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", MODE="0664"' | sudo tee /etc/udev/rules.d/10-libuvc.rules >/dev/null
sudo udevadm trigger
# Install Pupil Release
wget https://github.com/pupil-labs/pupil/releases/download/${PUPIL_RELEASE}/pupil_${PUPIL_VERSION}_linux_x64.zip
unzip pupil_${PUPIL_VERSION}_linux_x64.zip
sudo apt install -y ./pupil_${PUPIL_VERSION}_linux_x64/pupil_capture_linux_os_x64_${PUPIL_VERSION}.deb
sudo apt install -y ./pupil_${PUPIL_VERSION}_linux_x64/pupil_player_linux_os_x64_${PUPIL_VERSION}.deb
sudo apt install -y ./pupil_${PUPIL_VERSION}_linux_x64/pupil_service_linux_os_x64_${PUPIL_VERSION}.deb
rm -rf pupil_${PUPIL_VERSION}_linux_x64*
# Clone pupil repo
git clone https://github.com/pupil-labs/pupil.git "$WS_SRC"/pupil
python3 "$WS_SRC"/pupil/pupil_src/main.py capture --help
# Install requirements
python3 -m pip install --upgrade pip wheel
pip3 install -r "$WS_SRC"/pupil/requirements.txt
# Our requirements
sudo apt install -y libsdl2-dev ros-noetic-opencv-apps ros-noetic-derived-object-msgs
pip3 install -r "$SCRIPT_DIR"/requirements.txt
pip3 install -r "$SCRIPT_DIR"/requirements-dev.txt
# TELECARLA
git clone https://github.com/hofbi/telecarla.git "$WS_SRC"/telecarla && mv "$WS_SRC"/telecarla/telecarla_manual_control . && rm -rf "$WS_SRC"/telecarla/
# CARLA ROS Bridge
sudo apt-get install -y \
ros-noetic-ackermann-msgs \
ros-noetic-vision-opencv \
ros-noetic-rospy-message-converter \
ros-noetic-rviz \
ros-noetic-rqt-image-view \
ros-noetic-pcl-ros
git clone --recurse-submodules https://github.com/carla-simulator/ros-bridge.git "$WS_SRC"/ros-bridge
rm -rf "$WS_SRC"/ros-bridge/rqt_carla_control \
"$WS_SRC"/ros-bridge/rviz_carla_plugin \
"$WS_SRC"/ros-bridge/pcl_recorder \
"$WS_SRC"/ros-bridge/carla_ad_demo
rosdep update
rosdep install --from-paths src --ignore-src -r
pip3 install -r "$WS_SRC"/ros-bridge/requirements.txt
echo "Finished Driver Awareness Setup"