-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·69 lines (59 loc) · 2.12 KB
/
run.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
61
62
63
64
65
66
67
68
69
#!/bin/bash
my_pid=$$
echo "My process ID is $my_pid"
echo "Launching roscore..."
roscore &
pid=$!
sleep 3s
echo "Launching Gazebo..."
sleep 3s
roslaunch pioneer_gazebo world.launch &
pid="$pid $!"
sleep 5s
echo "Launching initialisation parameters..."
sleep 3s
roslaunch pioneer_description robot_description.launch &
pid="$pid $!"
roslaunch stage_assets product_description.launch &
pid="$pid $!"
roslaunch stage_assets generic_sdf_launcher.launch file:=5by5_out.sdf name:=5by5
pid="$pid $!"
for i in `seq 1 5`;
do
roslaunch stage_assets product.launch name:=product$i pose:="-x $(rosparam get /product$i/x) -y $(rosparam get /product$i/y) -Y $(rosparam get /product$i/a)" &
pid="$pid $!"
done
echo "Launching MapInformation 1..."
rosrun pioneer_control map_information &
pid="$pid $!"
rosrun pioneer_control product_manager &
pid="$pid $!"
for i in `seq 1 $1`;
do
# echo "Spawning Pioneer $i..."
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)" &
#roslaunch pioneer_control robotic_agent_full.launch id:="0" gridpos:="1 0 0 1" &
##rosrun pioneer_ros pioneer_tf_broadcaster model_name:=pioneer1
##rosrun pioneer_ros pioneer_odom_publisher model_name:=pioneer1
pid="$pid $!"
sleep 1s
done
#sleep 5s
#for i in `seq 1 5`;
#do
# roslaunch pioneer_control robotic_agent_full.launch id:="$i" gridpos:="$(rosparam get /pioneer$i/px) $(rosparam get /pioneer$i/py) $(rosparam get /pioneer$i/dy) $(rosparam get /pioneer$i/dy)" &
#done
#sleep 5s
#echo "Launching Pioneer 2..."
#roslaunch pioneer_description generic_pioneer.launch name:=pioneer2 pose:="-x 2 -y 2 -Y 1.57" &
#rosrun pioneer_ros pioneer_tf_broadcaster model_name:=pioneer2
#rosrun pioneer_ros pioneer_odom_publisher model_name:=pioneer2
#pid="$pid $!"
trap "echo Killing all processes.; kill -2 TERM $pid; exit" SIGINT SIGTERM
sleep 24h
#for i in `seq 1 5`;
#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