Files
AUV_150/missions/auv150/kill.sh
2025-08-12 10:42:30 +08:00

39 lines
1.3 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash -e
# 查找并杀死由launch.sh启动的进程
# 假设launch.sh启动的进程包含特定的标识符比如mission名称
# 定义进程标识符根据实际launch.sh启动的程序进行调整
#!/bin/bash -e
# Kill all processes launched by launch.sh
echo "Killing AUV150 mission processes..."
# Kill processes by name patterns
pkill -f "pAntler.*targ_vehicle.moos" 2>/dev/null || true
pkill -f "uMAC.*targ_vehicle.moos" 2>/dev/null || true
pkill -f "pNodeReporter" 2>/dev/null || true
pkill -f "uProcessWatch" 2>/dev/null || true
pkill -f "pHelmIvP" 2>/dev/null || true
pkill -f "pAUV150" 2>/dev/null || true
pkill -f "pShare" 2>/dev/null || true
pkill -f "pMarineViewer" 2>/dev/null || true
pkill -f "MOOSDB" 2>/dev/null || true
# Wait a moment for processes to terminate
echo "Waiting for processes to terminate..."
sleep 2
# Force kill any remaining processes
pkill -9 -f "pAntler.*targ_vehicle.moos" 2>/dev/null || true
pkill -9 -f "uMAC.*targ_vehicle.moos" 2>/dev/null || true
pkill -9 -f "pNodeReporter" 2>/dev/null || true
pkill -9 -f "uProcessWatch" 2>/dev/null || true
pkill -9 -f "pHelmIvP" 2>/dev/null || true
pkill -9 -f "pAUV150" 2>/dev/null || true
pkill -9 -f "pShare" 2>/dev/null || true
pkill -9 -f "pMarineViewer" 2>/dev/null || true
pkill -9 -f "MOOSDB" 2>/dev/null || true
echo "All AUV150 processes have been terminated."