-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsim_move_and_record.sh
More file actions
61 lines (60 loc) · 1.92 KB
/
sim_move_and_record.sh
File metadata and controls
61 lines (60 loc) · 1.92 KB
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
#! /bin/bash
{
gnome-terminal -t "roslaunch_main" -x bash -c "roslaunch platform_gazebo kinetic_main.launch; exec bash"
};
echo "Launching multi-sensor platform simulation..."
sleep 25s
{
gnome-terminal -t "pub_camera_fr_traj" -x bash -c "rosrun get_groundtruth camera_fr_traj.py; exec bash"
};
{
gnome-terminal -t "move_platform_py" -x bash -c " rosrun platform_gazebo move_platform_half_circle.py; exec bash"
};
echo "Wait a moment to get ready..."
{
sleep 19s
MID=`xdotool search --name "move_platform_py"`
for idm in $MID; do
xdotool windowactivate --sync $idm key --clearmodifiers 3
xdotool windowactivate --sync $idm key --clearmodifiers KP_Enter
done
gnome-terminal -t "rosbag_record" -x bash -c "source rosbag_record.sh; exec bash"
}
echo "Start moving the platform ..."
sleep 105s
echo "Stop everything ..."
WIDS=`xdotool search --name "rosbag_record"`
for idw in $WIDS; do
xdotool windowactivate --sync $idw key --clearmodifiers ctrl+c
sleep 1s
xdotool windowactivate --sync $idw key --clearmodifiers alt+F4
sleep 1s
done
echo "Stop rosbag record."
PIDS=`xdotool search --name "pub_camera_fr_traj"`
for idi in $PIDS; do
xdotool windowactivate --sync $idi key --clearmodifiers ctrl+c
sleep 1s
xdotool windowactivate --sync $idi key --clearmodifiers alt+F4
sleep 1s
done
echo "Stop publishing groundtruth."
MIDS=`xdotool search --name "move_platform_py"`
for idim in $MIDS; do
xdotool windowactivate --sync $idim key --clearmodifiers ctrl+c
sleep 1s
xdotool windowactivate --sync $idim key --clearmodifiers alt+F4
sleep 1s
xdotool windowactivate --sync $idim key --clearmodifiers alt+ctrl+w
sleep 1s
done
echo "Stop move_platform_py"
RIDS=`xdotool search --name "roslaunch_main"`
for idii in $RIDS; do
xdotool windowactivate --sync $idii key --clearmodifiers ctrl+c
sleep 1s
xdotool windowactivate --sync $idii key --clearmodifiers alt+F4
sleep 1s
done
echo "Stop Gazebo."
sleep 3s