-
Notifications
You must be signed in to change notification settings - Fork 63
/
install_file.sh
executable file
·126 lines (108 loc) · 2.11 KB
/
install_file.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
#!/bin/bash
FRONTEND=false
ORB_SLAM3=false
# check command line arguments
while getopts ":fo" opt; do
case $opt in
f)
FRONTEND=true
;;
o)
ORB_SLAM3=true
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
# shift command line arguments so that $1 is the first non-option argument
shift "$((OPTIND-1))"
if [ $# -eq 0 ]
then
NR_JOBS=""
CATKIN_JOBS=""
else
NR_JOBS=${1:-}
CATKIN_JOBS="-j${NR_JOBS}"
fi
FILEDIR=$(readlink -f ${BASH_SOURCE})
BASEDIR=$(dirname ${FILEDIR})
# BASEDIR is ??/<ws_name>/src/covins
echo "File directory: ${BASEDIR}"
cd ${BASEDIR}/..
wstool init
wstool merge covins/dependencies.rosinstall
wstool up
chmod +x covins/fix_eigen_deps.sh
./covins/fix_eigen_deps.sh
set -e
cd ${BASEDIR}/../..
catkin build ${CATKIN_JOBS} eigen_catkin opencv3_catkin
cd ${BASEDIR}/../..
source devel/setup.bash
cd ${BASEDIR}/covins_backend/
#DBoW2
cd thirdparty/DBoW2
if [ ! -d "build" ]
then
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j${NR_JOBS}
fi
cd ${BASEDIR}/../..
catkin build ${CATKIN_JOBS} covins_frontend
if [ "$FRONTEND" = true ] && [ "$ORB_SLAM3" = false ]; then
exit
fi
if [ "$ORB_SLAM3" = false ]; then
catkin build ${CATKIN_JOBS} covins_backend
fi
#Extract vocabulary
cd ${BASEDIR}/covins_backend/
cd config
if [ ! -f "ORBvoc.txt" ]
then
unzip ORBvoc.txt.zip
fi
cd ${BASEDIR}/../..
source devel/setup.bash
cd ${BASEDIR}/../pangolin
if [ ! -d "build" ]
then
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j${NR_JOBS}
fi
cd ${BASEDIR}/orb_slam3/Thirdparty/DBoW2
if [ ! -d "build" ]
then
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j${NR_JOBS}
fi
cd ${BASEDIR}/orb_slam3/Thirdparty/g2o
if [ ! -d "build" ]
then
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j${NR_JOBS}
fi
cd ${BASEDIR}/orb_slam3/Vocabulary
if [ ! -f "ORBvoc.txt" ]
then
tar -xf ORBvoc.txt.tar.gz
fi
cd ${BASEDIR}/orb_slam3
if [ ! -d "build" ]
then
mkdir build
fi
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j${NR_JOBS}
#finish
exit 0