-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera_localization.sh
More file actions
executable file
·46 lines (39 loc) · 1.41 KB
/
camera_localization.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.41 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
#!/bin/bash
# 設定顯示環境
export DISPLAY=:1
# Source ROS 2 環境
source /opt/ros/humble/setup.bash
source /home/vision/vision_ws/install/setup.bash
# export ROS_DOMAIN_ID=13
# 取得輸入參數並轉為小寫
MODE=$(echo "$1" | tr '[:upper:]' '[:lower:]')
TEAM=$(echo "$2" | tr '[:upper:]' '[:lower:]')
# --- 參數檢查 ---
if [[ "$MODE" != "robot" && "$MODE" != "sima" && "$MODE" != "all" ]]; then
echo "❌ Error: Invalid mode parameter."
echo "Usage: bash run_robot.sh [robot|sima|all] [blue|yellow]"
exit 1
fi
if [[ "$TEAM" != "blue" && "$TEAM" != "yellow" ]]; then
echo "❌ Error: Invalid team parameter. Please specify 'blue' or 'yellow'."
echo "Usage: bash run_robot.sh [robot|sima|all] [blue|yellow]"
exit 1
fi
echo "🎨 Team Selected: $TEAM"
# --- 啟動邏輯 ---
case "$MODE" in
"robot")
echo "🚀 Starting Robot Mode ($TEAM team)..."
ros2 launch aruco_robot robot_launch.py camera:=false rviz:=false team:=$TEAM
;;
"sima")
echo "🚀 Starting SIMA Mode ($TEAM team)..."
ros2 launch aruco_sima sima_launch.py camera:=true rviz:=false team:=$TEAM
;;
"all")
echo "🚀 Starting BOTH Robot and SIMA ($TEAM team)..."
ros2 launch aruco_robot robot_launch.py camera:=true rviz:=false team:=$TEAM &
sleep 3
ros2 launch aruco_sima sima_launch.py camera:=false rviz:=false team:=$TEAM
;;
esac