-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-pc.sh
105 lines (87 loc) · 3.7 KB
/
install-pc.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
#!/bin/bash
##NURDVISION INSTALLATION
echo "$(tput bold)Starting $(tput setaf 4)NURD$(tput setaf 1)Vision $(tput setaf 2)installation - INTERNET CONNECTION REQUIRED"
#UPDATES AND OTHER INSTALLS
#get ubuntu up to date and add repo
sudo add-apt-repository universe
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# LibsSTDC++6 linking libraries (to compile NURDVision properly with g++)
sudo apt-get -y install libstdc++6
# Some general development libraries
sudo apt-get -y install build-essential make cmake cmake-curses-gui g++
# libav video input/output development libraries
sudo apt-get -y install libavformat-dev libavutil-dev libswscale-dev
# Video4Linux camera development libraries
sudo apt-get -y install libv4l-dev v4l-utils
# Eigen3 math development libraries
sudo apt-get -y install libeigen3-dev
# OpenGL development libraries (to allow creating graphical windows)
sudo apt-get -y install libglew1.6-dev
# GTK development libraries (to allow creating graphical windows)
sudo apt-get -y install libgtk2.0-dev
# Emacs and nano
sudo apt-get -y install emacs nano
# Refresh installed libraries (if error @GLIBCXX_3.4.20 occurs follow steps: https://askubuntu.com/a/409831
sudo apt-get -y dist-upgrade
#UPDATES AND OTHER INSTALLS DONE
#OPENCV SETUP
cd ~/Downloads
rm 3.2.0.zip
wget https://github.com/opencv/opencv/archive/3.2.0.zip
cd ~/Downloads
unzip 3.2.0.zip
mv opencv-3.2.0 ~/
cd ~/opencv-3.2.0
mkdir build
cd build
cmake -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF ..
cmake -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_FAST_MATH=ON ..
cd ~/Downloads
rm 3.2.0.zip
wget https://github.com/opencv/opencv_contrib/archive/3.2.0.zip
unzip 3.2.0.zip
mv opencv_contrib-3.2.0 ~/
cd ~/opencv-3.2.0/build
cmake -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.2.0/modules ..
make -j4
sudo make install
#OPENCV SETUP DONE
echo "$(tput bold)$(tput setaf 2)OpenCV setup complete"
#LIBS & INCLUDE SETUP
#Libs & include setup is based on: https://github.com/SMblyRequired/Computer-Vision-2017/blob/master/installDeps.sh
cd
mkdir /tmp/libinstall
cd /tmp/libinstall
wget -O wpiutil.zip http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilib/wpiutil/1.0.2/wpiutil-1.0.2-desktop.zip
wget -O ntcore.zip http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilib/networktables/cpp/NetworkTables/3.1.7/NetworkTables-3.1.7-desktop.zip
wget -O cscore.zip http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/cscore/cpp/cscore/1.0.2/cscore-1.0.2-linux.zip
unzip wpiutil.zip
unzip ntcore.zip
unzip cscore.zip
sudo cp -r /tmp/libinstall/include/* /usr/local/include/
sudo cp -r /tmp/libinstall/Linux/amd64/* /usr/local/lib #use amd64 folder for 64-bit linux
sudo ldconfig
rm -rf /tmp/libinstall
#LIBS & INCLUDE SETUP DONE
#GRIP SETUP
cd
wget -O grip.deb https://github.com/WPIRoboticsProjects/GRIP/releases/download/v1.5.2/grip-1.5.2-x64.deb
sudo apt-get install ./grip.deb
#GRIP SETUP DONE
#ALIAS SETUP - CURRENTLY DISABLED
cd
wget https://raw.githubusercontent.com/FRCTeam3255/NURDVision/master/nurdcommands.txt
cat nurdcommands.txt >> .bash_aliases
#ALIAS SETUP DONE
#SETUP OUR CODE
cd
cd ~/Desktop
rm NURDVision.cpp
wget https://github.com/FRCTeam3255/NURDVision/raw/master/NURDVision.cpp
wget https://github.com/FRCTeam3255/NURDVision/raw/master/config.h
g++ NURDVision.cpp -std=c++11 -lopencv_calib3d -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio -lopencv_videostab -lntcore -lwpiutil -lcscore -o runNURDVision
#CODE SETUP DONE
echo "$(tput bold)$(tput setaf 4)NURD$(tput setaf 1)Vision $(tput setaf 2)installation complete"