-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·38 lines (30 loc) · 1018 Bytes
/
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
#!/bin/bash
echo "Script execution started."
# Launch p3dx_description_ros (Pioneer 3DX description) in the background
ros2 launch p3dx_description_ros p3dx_description_ros2.launch.py &
pid1=$!
if [ $? -ne 0 ]; then
echo "Failed to launch p3dx_description_ros. Exiting..."
exit 1
fi
# Delay for 1 second before launching the next process
sleep 1
# Launch the navigation2 localization with a custom map in the background
ros2 launch nav2_bringup localization_launch.py map:=./maps/RoboticsLab_1309_1529.yaml &
pid2=$!
if [ $? -ne 0 ]; then
echo "Failed to launch localization. Exiting..."
exit 1
fi
# Delay for 1 second before launching the next process
sleep 1
# Launch navigation for p3dx_description_ros in the background
ros2 launch p3dx_description_ros navigation_launch.py &
pid3=$!
if [ $? -ne 0 ]; then
echo "Failed to launch navigation for p3dx_description_ros. Exiting..."
exit 1
fi
# Wait for all background processes to complete
wait $pid1 $pid2 $pid3
echo "Script execution completed."