]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blob - scripts/wao_split.sh
Add real-world scenarios with artificial obstacles
[hubacji1/iamcar2.git] / scripts / wao_split.sh
1 #!/bin/bash
2
3 if [ $# -ne 2 ]
4 then
5     echo 'Split the first obstacle of the scenario'
6     echo ''
7     echo 'Usage:'
8     echo ''
9     echo -e '\t wao_split.sh IN_SCENARIO OUT_NAME'
10     echo ''
11     echo '- IN_SCENARIO is the scenario with obstacles'
12     echo '- OUT_NAME is the prefix for generated scenarios'
13     exit 1
14 fi
15
16 IS=$1
17 OS=$2
18 OD=scenarios_real-world-artificial-obstacles
19 t=$(mktemp)
20
21 python3 scripts/split_first_obstacle.py $IS | sed 's/'\''/"/g' > $t
22 R=$(cat $t | wc -l)
23
24 while [ $R -ge 0 ]
25 do
26     cat $t | head -$R | tail -1 > $OD/$OS-$R.json
27     R=$((R - 1))
28 done
29
30 rm $t