-
Notifications
You must be signed in to change notification settings - Fork 46
/
run_tests.sh
executable file
·47 lines (35 loc) · 981 Bytes
/
run_tests.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
#!/bin/bash
# Handle user early termination through SIGINT (or ctrl-c)
function userExit()
{
echo "Received ctrl-c or interrupt. Exiting."
./cleanup.sh
# Kill processes in our process group (our children)
kill -- -$$
}
checkIfNodesAreRunning()
{
# Check that the expected nodes are running
echo "check nodes are running"
#/achilles_APRILTAG
#/achilles_BASE2CAM
checkIfNodeIsRunning /achilles_BEHAVIOUR
#/achilles_MAP
#/achilles_NAVSAT
#/achilles_ODOM
#/gazebo
}
checkIfNodeIsRunning()
{
local node_name=$1
if [[ $(rosnode ping $node_name) = *"unknown node"* ]]; then
echo "Check failed: $node_name is not running."
exit 1
fi
}
# Trap SIGINT and call userExit
trap userExit SIGINT
# Run the headless simulation see sun_headless_sim.sh usage output for parameter definitions
setsid ./run_headless_sim.sh simulation/worlds/powerlaw_targets_example.world 3 /dev/null 2 42 &
sleep 30
checkIfNodesAreRunning