-
Notifications
You must be signed in to change notification settings - Fork 5
/
prerequisites.sh
executable file
·124 lines (100 loc) · 5.35 KB
/
prerequisites.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
#//bin/bash
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt update
sudo apt -y upgrade
sudo apt install -y ros-melodic-desktop-full freenect freeglut3* git-core cmake pkg-config build-essential libxmu-dev libxi-dev libudev* g++ python openjdk-11-jdk graphviz doxygen ros-melodic-rgbd-launch ros-melodic-openni-* ros-melodic-pcl-* ros-melodic-perception ros-melodic-perception-pcl ros-melodic-tf ros-melodic-roslib ros-melodic-orocos-kdl python-rosinstall python-rosinstall-generator python-wstool build-essential tlp ros-melodic-effort-controllers qt4-default python-scipy openjdk-11-jre openjdk-11-jdk gazebo9 ros-melodic-shape-msgs ros-melodic-pluginlib ros-melodic-class-loader ros-melodic-cv-bridge ros-melodic-cmake-modules ros-melodic-eigen-conversions ros-melodic-roslint python-pip python-imaging-tk
sudo pip install graphviz scipy tensorflow keras mttkinter Pillow
cd
rm -f sdk-tools-linux-4333796.zip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
rm -rf android-sdk
mkdir android-sdk
unzip sdk-tools-linux-4333796.zip -d android-sdk
rm sdk-tools-linux-4333796.zip
sudo rosdep init
rosdep update
sudo update-java-alternatives --set java-11-openjdk-amd64
echo '
source /opt/ros/melodic/setup.bash
source ~/sofar_ws/devel/setup.bash
export ROS_LANG_DISABLE=genlisp:gennodejs:geneus
export ANDROID_HOME=$HOME/android-sdk
export LC_NUMERIC="en_US.UTF-8"
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA_OPTS="-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee"
a=$(hostname -I);b=($a);export ROS_IP="${b[0]}";
a=$(hostname -I);b=($a);export ROS_HOSTNAME="${b[0]}";
' > ~/sofar_ws/.gbi_env
echo '
function bashrc(){
source ~/.bashrc
}
source ~/sofar_ws/.gbi_env
' >> ~/.bashrc
source ~/sofar_ws/.gbi_env
yes | sdkmanager --licenses
sudo adduser $USER plugdev
sudo usermod -a -G video $(whoami)
echo 2 | sudo tee -a /sys/module/usbcore/parameters/autosuspend
echo '
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c2", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02be", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02bf", MODE="0666"
SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ae", MODE="0660", GROUP="video"
SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ad", MODE="0660", GROUP="video"
SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02b0", MODE="0660", GROUP="video"
' | sudo tee /etc/udev/rules.d/66-kinect.rules
echo '
SUBSYSTEM=="usb", ATTR{idProduct}=="0200", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0300", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0401", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0500", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0600", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0601", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0609", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="1250", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="1260", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="1270", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="1280", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="1290", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="f9db", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
' | sudo tee /etc/udev/rules.d/557-primesense-usb.rules
sudo udevadm trigger
echo 'USB_BLACKLIST="045e:02b0 045e:02ad 045e:02ae"' | sudo tee -a /etc/default/tlp
sudo systemctl restart tlp
rm -rf ~/.bgi_dep_src
mkdir ~/.bgi_dep_src
cd ~/.bgi_dep_src
git clone https://github.com/libusb/libusb
git clone https://github.com/OpenKinect/libfreenect
git clone https://github.com/EmaroLab/OpenNI
git clone -b unstable https://github.com/PrimeSense/Sensor
git clone https://github.com/arnaud-ramey/NITE-Bin-Dev-Linux-v1.5.2.23
cd ~/.bgi_dep_src/libusb
./autogen.sh
make
sudo make install
cd ~/.bgi_dep_src/libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/
cd ~/.bgi_dep_src/OpenNI/Platform/Linux/CreateRedist
./RedistMaker
cd ../Redist/OpenNI-Bin-Dev-Linux-*
sudo ./install.sh
cd ~/.bgi_dep_src/Sensor/Platform/Linux/CreateRedist
./RedistMaker
cd ../Redist/Sensor-Bin-Linux-*
sudo ./install.sh
sudo rm -f /usr/lib/libXnVNite.so
cd ~/.bgi_dep_src/NITE-Bin-Dev-Linux-v1.5.2.23/x64
sudo ./install.sh