-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·81 lines (74 loc) · 2.51 KB
/
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
#!/bin/bash
showHelp() {
echo
echo "usege: install.sh [-h] [-i] [-t] [-r]"
echo
echo "Clone application pacakges and all pacakges specifically related do CIR-KIT-Unit03."
echo "Packages to be cloned are defined in cirkit_unit03_apps.rosinstall and cirkit_unit03_pkgs.rosinstall."
echo
echo "Application packages for CIR-KIT-Unit03 are cloned into cirkit_unit03_apps directory."
echo "Basical packages for CIR-KIT-Unit03 are cloned into cirkit_unit03_pkgs directory."
echo "Dependent packages for CIR-KIT-Unit03 are cloned into cirkit_unit03_deps directory."
echo
echo "Directory configuration after install is supposed to be as follows."
echo " <catkin_ws>"
echo " |"
echo " |- src"
echo " |"
echo " |- cirkit_unit03_apps"
echo " | |"
echo " | |- (application pkgs cloned via cirkit_unit03_apps.rosinstall)"
echo " |"
echo " |"
echo " |- cirkit_unit03_deps (Just a directory, not a metapacage)"
echo " | |"
echo " | |- (dependent pkgs cloned via cirkit_unit03_pkgs.rosinstall)"
echo " |"
echo " |- cirkit_unit03_pkgs"
echo " |"
echo " |- (basical pkgs cloned via cirkit_unit03_pkgs.rosinstall)"
echo
echo "optional arguments:"
echo " -h show this help message and exit"
echo " -i eneble rosdep init"
echo " -t enable catkin_make run_tests"
echo " -r remove existing src/.rosinstall"
}
# Options
while getopts hirt OPT
do
case $OPT in
"h" ) showHelp
exit 0 ;;
"i" ) FLG_I="TRUE" ;;
"r" ) FLG_R="TRUE" ;;
"t" ) FLG_T="TRUE" ;;
* ) echo "Usage: $CMDNAME [-h -i -t]" 1>&2
exit 1 ;;
esac
done
# Clone cirkit_unit03_pkgs repository
git clone https://github.com/CIR-KIT-Unit03/cirkit_unit03_pkgs.git ../cirkit_unit03_pkgs
# Download required packages by wstool.
cd ../../
if [ "$FLG_R" = "TRUE" ]; then
echo "Removing src/.rosinstall"
rm src/.rosinstall
fi
wstool init src
wstool merge -t src src/cirkit_unit03_pkgs/cirkit_unit03_pkgs.rosinstall
wstool merge -t src src/cirkit_unit03_apps/cirkit_unit03_apps.rosinstall
wstool update -t src
# Download depended packages by rosdep.
if [ "$FLG_I" = "TRUE" ]; then
sudo rosdep init
fi
rosdep update
rosdep install -i -r -y --from-paths src --ignore-src
# Build packages, and set the path for the packages.
catkin_make
source devel/setup.bash
if [ "$FLG_T" = "TRUE" ]; then
catkin_make run_tests
catkin_test_results
fi