-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_data_collection.sh
More file actions
executable file
·46 lines (35 loc) · 1.56 KB
/
start_data_collection.sh
File metadata and controls
executable file
·46 lines (35 loc) · 1.56 KB
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
#!/bin/bash
# Initialize param_value with default value
param_value="default"
# Parse command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--param)
param_value="$2"
shift # past argument
shift # past value
;;
*) # unknown option
echo "Unknown option: $1"
usage
;;
esac
done
# Validate param_value
if [[ "$param_value" != "color" && "$param_value" != "depth" && "$param_value" != "orb" && "$param_value" != "default" && "$param_value" != "validation" ]]; then
echo "Invalid parameter: $param_value, use: --param {color|depth|orb|default|validation}"
fi
# Launch camera Docker
gnome-terminal --title='Camera Docker' -- /bin/bash -c './launch_depthai_ros.sh'
# Launch high level model if param_value is "color", "depth" or "orb"
if [[ "$param_value" == "color" || "$param_value" == "depth" || "$param_value" == "orb" ]]; then
gnome-terminal --title='High level model' -- /bin/bash -c "docker exec -it ap4hlc /bin/bash -c \"source autonomous_drive_startup.bash $param_value\""
fi
# Launch data collection
gnome-terminal --title='Data collection' -- /bin/bash -c "docker exec -it ap4hlc /bin/bash -c \"source data_collection_startup.bash $param_value\""
sleep 3
# Launch ROS bag
gnome-terminal --title='ROS bag' -- /bin/bash -c "docker exec -it ap4hlc /bin/bash -c \"source rosbag_startup.bash $param_value\""
# Launch test script
gnome-terminal --title='Test script' -- /bin/bash -c 'docker exec -it ap4hlc /bin/bash -c "source test_script.bash"'