-
Notifications
You must be signed in to change notification settings - Fork 10
/
run_multi_pioneer
executable file
·51 lines (40 loc) · 1.27 KB
/
run_multi_pioneer
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
#!/bin/bash
PATH=$(echo $PATH | sed 's|/home/aadi-workstation/anaconda3/bin:||g')
export PATH=$PATH
my_pid=$$
echo "My process ID is $my_pid"
echo "Launching roscore..."
roscore &
pid=$!
echo "Launching Gazebo..."
sleep 10s
roslaunch pioneer_gazebo multi_pioneer_world.launch &
pid="$pid $!"
echo "Loading initialisation parameters..."
sleep 10s
roslaunch pioneer_description robot_description.launch pose_file:=pioneer_poses
echo "Launching Pioneers in Gazebo stack..."
sleep 5s
for i in `seq 1 2`;
do
roslaunch pioneer_description generic_pioneer.launch name:=pioneer$i pose:="-x $(rosparam get /pioneer$i/x) -y $(rosparam get /pioneer$i/y) -Y $(rosparam get /pioneer$i/a)" &
pid="$pid $!"
sleep 7s
done
echo "Launching map server..."
sleep 5s
roslaunch nav_bundle map_server.launch &
pid="$pid $!"
echo "Launching navigation stack..."
sleep 5s
for i in `seq 1 2`;
do
roslaunch nav_bundle single_navigation.launch robot_name:=pioneer$i x:="$(rosparam get /pioneer$i/x)" y:="$(rosparam get /pioneer$i/y)" yaw:="$(rosparam get /pioneer$i/a)" &
pid="$pid $!"
sleep 2s
done
echo "Launching rviz..."
roslaunch pioneer_description multi_pioneer_rviz.launch rviz_config:=multi_pioneer&
pid="$pid $!"
trap "echo Killing all processes.; kill -2 TERM $pid; exit" SIGINT SIGTERM
sleep 24h