-
Notifications
You must be signed in to change notification settings - Fork 26
/
run_simulation.sh
executable file
·134 lines (111 loc) · 3.3 KB
/
run_simulation.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
#!/usr/bin/env bash
# Source our workspace directory to load ENV variables
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source ${SCRIPT_DIR}/../../../devel/setup.bash
#=============================================================
#=============================================================
#=============================================================
# dataset locations
datasets=(
"udel_arl_short"
# "udel_room_05"
# "udel_room_05_short"
)
# how far we should start into the dataset
# this can be used to skip the initial sections
do_msckf_plane=(
"false"
"true"
)
do_slam_plane=(
"false"
"true"
)
sigma_c=(
"0.001"
# "0.01"
# "0.05"
# "0.10"
)
max_slam=(
"00"
"15"
# "30"
)
# location to save log files into
base_path="/home/patrick/workspace/catkin_ws_plane/src/ov_plane/results"
save_path1="$base_path/sim_general/algorithms"
save_path_gt="$base_path/sim_general/truths"
save_path2="$base_path/sim_general/timings"
sufix=""
#=============================================================
#=============================================================
#=============================================================
# Loop through all datasets
for i in "${!datasets[@]}"; do
for a in "${!do_msckf_plane[@]}"; do
for b in "${!sigma_c[@]}"; do
for c in "${!max_slam[@]}"; do
for d in "${!do_slam_plane[@]}"; do
# groundtruth file save location
# ONLY SAVE FOR NONE SO WE DON'T KEEP OVERWRITTING IT!
if [[ "${do_msckf_plane[a]}" == "false" ]]; then
filename_gt="$save_path_gt/${datasets[i]}.txt"
else
filename_gt="/tmp/groundtruth.txt"
fi
# Monte Carlo runs for this dataset
# If you want more runs, change the below loop
for j in {00..19}; do
# for none loop we only need to run the first one
if [[ "${do_msckf_plane[a]}" == "false" && "$b" != "0" ]]; then
break
fi
if [[ "${do_msckf_plane[a]}" == "false" && "${do_slam_plane[d]}" == "true" ]]; then
break
fi
# start timing
start_time="$(date -u +%s)"
foldername="${max_slam[c]}slam"
if [ "${do_msckf_plane[a]}" == "true" ]
then
foldername="${max_slam[c]}slam_${sigma_c[b]}plane"
fi
if [[ "${do_msckf_plane[a]}" == "true" && "${do_slam_plane[d]}" == "true" ]]
then
foldername="${foldername}_slam"
fi
foldername="${foldername}${sufix}"
filename_est="$save_path1/$foldername/${datasets[i]}/${j}_estimate.txt"
filename_time="$save_path2/$foldername/${datasets[i]}/${j}_timing.txt"
roslaunch ov_plane simulation.launch \
verbosity:="WARNING" \
seed:="$((10#$j + 5))" \
dataset:="${datasets[i]}.txt" \
use_plane_constraint:="${do_msckf_plane[a]}" \
use_plane_constraint_msckf:="${do_msckf_plane[a]}" \
use_plane_constraint_slamu:="${do_msckf_plane[a]}" \
use_plane_constraint_slamd:="${do_msckf_plane[a]}" \
use_plane_slam_feats:="${do_slam_plane[d]}" \
use_refine_plane_feat:="true" \
use_groundtruths:="false" \
sigma_constraint:="${sigma_c[b]}" \
const_init_multi:="1.00" \
num_pts:="0" \
num_pts_plane:="150" \
num_slam:="${max_slam[c]}" \
dosave_pose:="true" \
path_est:="$filename_est" \
path_gt:="$filename_gt" \
dotime:="true" \
path_time:="$filename_time" &> /dev/null
# print out the time elapsed
end_time="$(date -u +%s)"
elapsed="$(($end_time-$start_time))"
echo "BASH: $foldername - ${datasets[i]} - run $j took $elapsed seconds";
done
done
done
done
done
done