forked from microsoft/lamar-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker_run_merge_spot.sh
More file actions
executable file
·55 lines (45 loc) · 1.59 KB
/
docker_run_merge_spot.sh
File metadata and controls
executable file
·55 lines (45 loc) · 1.59 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
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Flags and arguments:
# --input_file : path to the input pairs file
# --output_path : path to same merged bagfiles
# --nuc_path : path to the directory storing nuc bagfiles
# --orin_path : path to the directory storing orin bagfiles
# --scene : name of the scene, all capital leters
if [ -z "$CAPTURE_DIR" ]; then
echo "[ERROR] CAPTURE_DIR env var not set. Make sure to export CAPTURE_DIR=/path/to/data/root."
exit 1
fi
if [ -z "$LOCATION" ]; then
echo "[ERROR] LOCATION env var not set. Make sure to export LOCATION=location."
exit 1
fi
CAPTURE="${CAPTURE_DIR}/${LOCATION}"
NUC_PATH="${CAPTURE}/raw/spot/nuc"
ORIN_PATH="${CAPTURE}/raw/spot/orin"
OUTPUT_PATH="${CAPTURE}/raw/spot/merged"
INPUT_FILE="${CAPTURE}/raw/spot/spot_sessions_to_merge.txt"
echo "You are running with parameters: "
echo " Capture: ${CAPTURE}"
echo " Nuc path: ${NUC_PATH}"
echo " Orin path: ${ORIN_PATH}"
echo " Output path: ${OUTPUT_PATH}"
echo " Input file: ${INPUT_FILE}"
read -p "Do you want to continue? (y/n): " answer
if [[ ! "$answer" =~ ^[Yy]$ ]]; then
echo "Execution aborted."
exit 1
fi
echo "Running run_merge_bagfiles on $LOCATION inside a Docker ..."
docker run --rm \
-v "$NUC_DIR":/data/nuc_dir \
-v "$ORIN_DIR":/data/orin_dir \
-v "$OUTPUT_DIR":/data/merged_dir \
-v "$INPUT_FILE":/data/input.txt \
croco:scantools \
python3 -m scantools.run_merge_bagfiles \
--input_file /data/input.txt \
--output_path /data/merged_dir \
--nuc_path /data/nuc_dir \
--orin_path /data/orin_dir \
--scene "$LOCATION"
echo "Done, run_merge_bagfiles process complete on $LOCATION."