-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsim_launch.bash
executable file
·57 lines (50 loc) · 1.7 KB
/
sim_launch.bash
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
#!/bin/bash
# Define the user's password (replace YOUR_PASSWORD with the actual password)
SUDO_PASSWORD="YOUR_PASSWORD"
# Kill any existing CARLA processes
CARLA_PROCESS=$(ps aux | grep '[C]arlaUE4-Linux-Shipping' | awk '{print $2}')
if [ ! -z "$CARLA_PROCESS" ]; then
echo "Terminating existing CARLA processes..."
echo $SUDO_PASSWORD | sudo -S kill -9 $CARLA_PROCESS
fi
cd
# Start a terminal to monitor system usage
gnome-terminal -- bash -c "
cd carla_simulator/
source carla-env/bin/activate
cd ~/Desktop/Self-Driving-Stack/Project/Collaborative-Vehicle-2-Vehicle-System/utils.
python3 monitor_usgae.py
exec bash
" & # Run in background
wait $! # Wait for the terminal process to start
sleep 10 # Wait for 10 seconds
# Start the first terminal and run CARLA simulator
gnome-terminal -- bash -c "
cd carla_simulator/
source carla-env/bin/activate
./CarlaUE4.sh
exec bash
" & # Run in background
wait $! # Wait for the terminal process to start
sleep 10 # Wait for 10 seconds
# Start the second terminal and run the main Python script
gnome-terminal -- bash -c "
cd carla_simulator/
source carla-env/bin/activate
cd ~/Desktop/Self-Driving-Stack/Project/Collaborative-Vehicle-2-Vehicle-System/
python3 main.py
exec bash
" & # Run in background
wait $! # Wait for the terminal process to start
sleep 10 # Wait for 10 seconds
# Start the third terminal and run the visualization scripts
gnome-terminal -- bash -c "
cd carla_simulator/
source carla-env/bin/activate
cd ~/Desktop/Self-Driving-Stack/Project/Collaborative-Vehicle-2-Vehicle-System/agents/
python3 visualize_ego.py
python3 visualize_ego.py
exec bash
" & # Run in background
wait $! # Wait for the terminal process to start
sleep 10 # Wait for 10 seconds