-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·45 lines (40 loc) · 1.18 KB
/
run.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
#!/bin/bash
usage() { echo "Usage: $0 [-m] [-r <robot_name>] [-s <number>]" 1>&2; exit 1; }
while getopts "mr:s:t:" o; do
case "${o}" in
r)
rn=${OPTARG}
;;
s)
markers=${OPTARG}
;;
m)
m=1
;;
t) rot=${OPTARG}
;;
esac
done
if (( $OPTIND == 1 )); then
rn='thymio17'
markers=2
fi
if [[ -z "${rn}" ]]; then
rn='thymio17'
fi
if [[ "${markers}" < 1 ]]; then
markers=2
fi
if [[ "${rot}" != "true" && "${rot}" != "false" ]]; then
#statements
rot='false'
fi
echo "running the following command:\n roslaunch MightyCleaner thymiolaunch.launch name:=${rn} markers:=${markers} rotate:=${rot}"
if [[ ${m} == 1 ]]; then
#statements
export ROS_MASTER_URI=http://"${rn}":11311
catkin_make && source ~/catkin_ws/devel/setup.bash && roslaunch MightyCleaner thymiolaunch.launch name:="${rn}" markers:="${markers}" rotate:="${rot}"2> /dev/null
else
export ROS_MASTER_URI=http://"${rn}":11311
catkin build && source ~/catkin_ws/devel/setup.bash && roslaunch MightyCleaner thymiolaunch.launch name:="${rn}" markers:="${markers}" rotate:="${rot}" 2> /dev/null
fi