-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_system.sh
More file actions
executable file
·53 lines (43 loc) · 1.07 KB
/
launch_system.sh
File metadata and controls
executable file
·53 lines (43 loc) · 1.07 KB
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
#!/bin/bash
# Launch script for SkyScout system
echo "Starting SkyScout drone control system..."
# Function to cleanup on exit
cleanup() {
echo "Shutting down SkyScout..."
kill $ROS_PID $ROSBRIDGE_PID $WEB_PID 2>/dev/null
exit 0
}
trap cleanup EXIT INT TERM
# Check if ROS2 is sourced
if [ -z "$ROS_DISTRO" ]; then
echo "Sourcing ROS2..."
source /opt/ros/iron/setup.bash
fi
# Source workspace
cd ros_ws
source install/setup.bash
cd ..
# Launch ROS2 nodes
echo "Launching ROS2 nodes..."
ros2 launch skyscout_bringup skyscout.launch.py &
ROS_PID=$!
sleep 3
# Launch rosbridge
echo "Starting rosbridge websocket server..."
ros2 launch rosbridge_server rosbridge_websocket_launch.xml &
ROSBRIDGE_PID=$!
sleep 2
# Launch web frontend
echo "Starting web interface..."
cd web_frontend
npm run dev &
WEB_PID=$!
cd ..
echo "----------------------------------------"
echo "SkyScout is running!"
echo "Web interface: http://localhost:3000"
echo "ROS bridge: ws://localhost:9090"
echo "Press Ctrl+C to stop"
echo "----------------------------------------"
# Wait for processes
wait