-
Notifications
You must be signed in to change notification settings - Fork 0
/
sailor_install.sh
executable file
·118 lines (100 loc) · 4.01 KB
/
sailor_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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
ROS2HOME=~/ros2_ws/
ROS2HOME_SRC=~/ros2_ws/src
dowload_sailor_dependencies(){
cd $ROS2HOME_SRC
git clone [email protected]:uleroboticsgroup/simple_node.git
git clone [email protected]:uleroboticsgroup/kant.git
git clone --recurse-submodules https://github.com/mgonzs13/ros2_asus_xtion
git clone --recurse-submodules https://github.com/mgonzs13/openrobotics_darknet_ros.git
git clone [email protected]:mgonzs13/sailor.git
}
dowload_sailor(){
cd $ROS2HOME_SRC
git clone [email protected]:mgonzs13/sailor.git
# SAILOR dependencies
cd src/sailor
pip3 install -r sailor/requirements.txt
}
install_kant_dependencies(){
# kant dependencies
sudo apt install python3-pip git python3-rosdep2
sudo pip3 install mongoengine dnspython
}
# Ubuntu 20, mongoc 1.16.1
install_mongocxx_dependencies_ubuntu20(){
cd $HOME
# Mongocxx
sudo apt install libmongoc-dev libmongoc-1.0-0 -y
curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/refs/tags/r3.4.2.tar.gz
tar -xzf r3.4.2.tar.gz
cd mongo-cxx-driver-r3.4.2/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBSONCXX_POLY_USE_BOOST=1
cmake --build .
sudo cmake --build . --target install
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
rm r3.4.2.tar.gz
rm -rf mongo-cxx-driver-r3.4.2
}
# Ubuntu 22, mongoc 1.16.1
install_mongocxx_dependencies_ubuntu22(){
cd $HOME
# Mongocxx
sudo apt install libmongoc-dev libmongoc-1.0-0 -y
curl -OL https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.7/mongo-cxx-driver-r3.6.7.tar.gz
tar -xzf mongo-cxx-driver-r3.6.7.tar.gz
cd mongo-cxx-driver-r3.6.7/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBSONCXX_POLY_USE_BOOST=1
cmake --build .
sudo cmake --build . --target install
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
cd
rm mongo-cxx-driver-r3.6.7.tar.gz
rm -rf mongo-cxx-driver-r3.6.7
}
install_mongodb_20(){
# MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
sudo apt-get install gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/$ sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongodb
}
install_mongodb_22(){
# Ubuntu 22 trick
# https://askubuntu.com/questions/1403619/mongodb-install-fails-on-ubuntu-22-04-depends-on-libssl1-1-but-it-is-not-insta
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb
# MongoDB
# https://wiki.crowncloud.net/?How_to_Install_Latest_MongoDB_on_Ubuntu_22_04
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongod.service
sudo systemctl status mongod.service
}
launch_rosdep(){
# rosdep
cd $ROS2HOME
rosdep install --from-paths src -r -y
}
launch_colcon(){
# colcon
cd $ROS2HOME
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DDARKNET_OPENCV=Off --packages-select darknet_vendor
colcon build
}
#install_kant_dependencies
install_mongocxx_dependencies_ubuntu22
install_mongodb_22
#dowload_sailor_dependencies
#dowload_sailor
#sudo apt-get install python3-rosdep2
#launch_rosdep
#launch_colcon