-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_demo.sh
60 lines (56 loc) · 1.37 KB
/
run_demo.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
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# check camera node exist
echo "Checking Tier IV C1 camera nodes..."
ls /dev/gmsl/tier4-isx021-cam1
if [ "$?" != 0 ]; then
echo "tier4-isx021-cam1 not found"
exit 2
fi
ls /dev/gmsl/tier4-isx021-cam3
if [ "$?" != 0 ]; then
echo "tier4-isx021-cam3 not found"
exit 2
fi
ls /dev/gmsl/tier4-isx021-cam5
if [ "$?" != 0 ]; then
echo "tier4-isx021-cam5 not found"
exit 2
fi
ls /dev/gmsl/tier4-isx021-cam7
if [ "$?" != 0 ]; then
echo "tier4-isx021-cam7 not found"
exit 2
fi
# check lidar alive
echo "Checking OS1-32 LiDAR is active or not..."
RETRY=5
for ((i=1; i<=$RETRY; i++))
do
ping os-122226001129.local -c 3 -W 3
ping_result=$?
if [ "$ping_result" == 0 ]; then
echo ""
echo "LiDAR is active now."
break
else
if [ $i != $RETRY ]; then
echo "Retry ($i/$RETRY)"
else
echo "-----------------------------------------------------------------"
echo "Error! LiDAR is not active, please check if LiDAR is powered up."
echo "-----------------------------------------------------------------"
exit 1
fi
fi
done
# restart PTP daemon for lidar to sync with RQX
echo "Enter login password to reset IEEE 1588 (PTP) daemon"
sudo systemctl restart ptp4l
echo "Waiting for IEEE 1588 (PTP) time sync between LiDAR and RQX..."
for i in {1..10};
do
echo "."
sleep 1
done
# run demo scripts
roslaunch ew_demo ew_demo.launch