-
Notifications
You must be signed in to change notification settings - Fork 1
/
ims_run
executable file
·87 lines (62 loc) · 2.08 KB
/
ims_run
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
#!/bin/bash
RUNNING=$(redis-cli llen ims_pids)
if [ "$RUNNING" -ne "0" ]
then
echo "IMS instance already running"
exit 1
fi
IMS_PATH=/home/gustavo/devel/personal/python/ims-py
echo "IMS started"
config_file=$1
config_data=$(cat $config_file | tr -s '\n\t ' ' ')
redis-cli flushdb
echo "Loading configuration file $1"
redis-cli hset ims config_file "$IMS_PATH/$1"
redis-cli hset ims config "$config_data"
redis-cli hset ims base_path "$IMS_PATH"
echo "Starting ims_main process"
python3 $IMS_PATH/nodes/ims_main.py &
redis-cli lpush ims_pids $!
# echo "Starting legs_state_plotter process"
# python3 $IMS_PATH/utils/legs_state_plotter.py &
# redis-cli lpush ims_pids $!
sleep 2
# start range publishers
rs_name_list=$(redis-cli get ims.rs_name_list)
out_ch_list=""
out_raw_ch_list=""
for i in $rs_name_list
do
rs_src=$(redis-cli get ims.rs.$i.src)
echo "Starting publisher for range sensor $i: $rs_src"
python3 $IMS_PATH/nodes/laser_publisher.py $i $rs_src &
redis-cli lpush ims_pids $!
sleep 0.5
echo "Starting bg_remove for range sensor $i"
python3 $IMS_PATH/nodes/laser_bg_remove.py $i &
redis-cli lpush ims_pids $!
sleep 0.5
echo "Starting pol2cart for range sensor $i"
python3 $IMS_PATH/nodes/laser_pol2cart.py $i "no_bg" &
redis-cli lpush ims_pids $!
echo "Starting pol2cart for range sensor $i"
python3 $IMS_PATH/nodes/laser_pol2cart.py $i "raw" &
redis-cli lpush ims_pids $!
out_ch="ims/laser/$i/no_bg/cart"
out_raw_ch="ims/laser/$i/raw/cart"
out_ch_list="$out_ch_list $out_ch"
out_raw_ch_list="$out_raw_ch_list $out_raw_ch"
done
echo "Starting points2occgrid for range sensors"
echo $out_raw_ch_list
p2occ_outch="ims/laser/all/occgrid"
python3 nodes/points2occgrid.py -ich $out_raw_ch_list -och ims/laser/all/occgrid &
redis-cli lpush ims_pids $!
echo "Starting laser_cart_merge node"
python3 nodes/laser_cart_merge.py -ichs $out_ch_list -och ims/laser/all/no_bg/cart &
redis-cli lpush ims_pids $!
echo "Starting points2cluster_merge node"
python3 nodes/points2cluster.py ims/laser/all/no_bg/cart ims/laser/clusters &
redis-cli lpush ims_pids $!
sleep 1000
#-----