forked from hkbharath/AutoDroneDelivery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runme.sh
47 lines (41 loc) · 1.12 KB
/
runme.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
#!/bin/bash
VENV_NAME="environment"
SERVER_CONFIG="local_server_config.json"
RECORD_PREFIX="record"
CODEBASE="integrated"
SIMULATION="simulation"
if [[ "$1" == "help" || "$1" == "-h" ]]
then
echo "Usage:"
echo "runme.sh server <server id>"
echo "runme.sh drone <drone id> <server id>"
echo "runme.sh drone_monitor"
echo "runme.sh help"
exit 0
fi
if [ ! -d $VENV_NAME ]
then
python3 -m venv $VENV_NAME
if [ $? == 0 ]
then
echo "venv created"
fi
source $VENV_NAME/bin/activate
pip install dependencies/*.whl
if [ $? == 0 ]
then
echo "Installed dependencies"
fi
else
source $VENV_NAME/bin/activate
fi
if [[ "$1" == "drone" ]]
then
python $CODEBASE/drone.py --drone-id $2 --server-id $3 --server-config $SERVER_CONFIG --simulation-dir $SIMULATION
elif [[ "$1" == "server" ]]
then
python $CODEBASE/base_loc.py --server-id $2 --server-config $SERVER_CONFIG --record-dir "${RECORD_PREFIX}_$2"
elif [[ "$1" == "drone_monitor" ]]
then
python integrated/base_loc.py --drone-id 3 --server-id 3 --server-config $SERVER_CONFIG --simulation-dir $SIMULATION
fi