forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_test.sh
executable file
·44 lines (36 loc) · 1.03 KB
/
_test.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
#!/bin/bash
if [ $# -eq 0 ]
then
echo "EEROR!: No arguments supplied!"
else
if test -f "$HOME/src/bags/[email protected]"
then
echo "EEROR!: File [email protected] already exists on '$HOME/src/bags/'!"
else
make px4_sitl_default gazebo_iris &
RUNNING_PX4_GAZEBO_PID=$!
sleep 6
roslaunch mavros px4.launch fcu_url:='udp://:[email protected]:14555' &
RUNNING_ROSCORE_PID=$!
sleep 3
echo "Recording BAG $@"
rosbag record -a -o "$HOME/src/bags/" -O "$@" &
RUNNING_ROSBAG_PID=$!
rosrun wpg v6_fuzzy_vel_smc_py3.py
sleep 1
echo ""
echo "Killing rosbag process with PID $RUNNING_ROSBAG_PID..."
kill -sSIGINT $RUNNING_ROSBAG_PID
echo "Rosbag process killed!"
sleep 1
echo ""
echo "Killing px4_gazebo process with PID $RUNNING_PX4_GAZEBO_PID..."
kill -sSIGINT $RUNNING_PX4_GAZEBO_PID
echo "Px4_gazebo process killed!"
sleep 1
echo ""
echo "Killing roscore process with PID $RUNNING_ROSCORE_PID..."
kill -sSIGINT $RUNNING_ROSCORE_PID
echo "Roscore process killed!"
fi
fi