forked from raulmur/ORB_SLAM2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_opencv_ros_orb_script.sh
executable file
·175 lines (123 loc) · 4.38 KB
/
install_opencv_ros_orb_script.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/env bash
echo "[ ** ] updating"
sudo apt-get update
sudo apt-get -y upgrade
echo "[ ** ] installing cmake and git"
sudo apt-get -y install cmake git
echo "[ ** ] installing opencv"
sudo apt-get -y install libopencv-dev python3-opencv
echo "[ ** ] installing more deps"
sudo apt-get -y install libeigen3-dev libblas-dev liblapack-dev libglew-dev
echo "[ ** ] installing Pangolin"
cd ~
git clone https://github.com/stevenlovegrove/Pangolin
cd Pangolin
mkdir build
cd build
cmake ..
make -j4
make install
echo "finished making Pangolin"
echo "[ ** ] clone ORB-SLAM2 from github"
cd ~
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
echo "[ ** ] Installing ROS"
# according to this tutorial https://www.hackster.io/dmitrywat/ros-melodic-on-raspberry-pi-4-debian-buster-rplidar-a1m8-0d63d1
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-get -y update
sudo apt-get -y upgrade
sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
sudo rosdep init
rosdep update
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar > melodic-desktop-wet.rosinstall
wstool init -j4 src melodic-desktop-wet.rosinstall
# if error continuew with this command
# wstool update -j 4 -t src
# fixing issues according to tutorial
# https://www.seeedstudio.com/blog/2019/08/01/installing-ros-melodic-on-raspberry-pi-4-and-rplidar-a1m8/
mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install
sudo apt-get -y install libogre-1.9-dev
exit 1
echo "stopped install HERE" find this line in script and continue manually"
# stop here!
# run
cd ~/ros_catkin_ws/
find -type f -print0 | xargs -0 grep 'boost::posix_time::milliseconds' | cut -d: -f1 | sort -u
# look for 'boost::posix_time::milliseconds'
# fix resulting files according to this convention
# replace calls like this:
# boost::posix_time::milliseconds(loop_duration.toSec() * 1000.0f));
# with:
# boost::posix_time::milliseconds(int(loop_duration.toSec() * 1000.0f)));
# AND
# calls like this:
# boost::posix_time::milliseconds(1000.0f)
# with:
# boost::posix_time::milliseconds(1000)
# continue here
# long time
rosdep install --from-paths src --ignore-src --rosdistro melodic -y
# long time
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j2
echo "[ ** ] Finished ROS install"
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-empy
##########################################
# dependecies for video transfer (ogg)
cd ~
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
tar -xf libogg-1.3.1.tar.gz
cd libogg-1.3.1/
./configure --host=arm-unknown-linux-gnueabi --enable-static
make
sudo make install
cd ~
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar -xf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3/
./configure --host=arm-unknown-linux-gnueabi --enable-static
make
sudo make install
cd ~
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar -xf libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1/
./configure --host=arm-unknown-linux-gnueabi --enable-static
make
sudo make install
exit(1)
echo "clean examples from makefile, didn\'t compile for me"
###############################################
cd ~
mkdir -p catkin_ws/src
cd catkin_ws
catkin_make
cd src
git clone https://github.com/UbiquityRobotics/raspicam_node.git
git clone https://github.com/ros-perception/image_transport_plugins.git
git clone https://github.com/ros-perception/image_common.git
# to see and test camera
roslaunch raspicam_node camerav2_1280x960.launch &
rosrun raspicam_node imv_view.py
# additional info at git repo raspicam_node
####################
cd ~/catkin_ws
catkin_make
######################
# hopefully run with ros:
echo "export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/ORB_SLAM2/Examples/ROS" >> ~/.bashrc
source ~/.bashrc