-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_vertical_chess.sh
More file actions
executable file
·142 lines (132 loc) · 4.46 KB
/
Copy pathlaunch_vertical_chess.sh
File metadata and controls
executable file
·142 lines (132 loc) · 4.46 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env bash
# Vertical Chess Launch Script
# Convenience wrapper for launching the complete vertical chess system
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} Vertical Chess System Launcher${NC}"
echo -e "${BLUE}========================================${NC}"
echo
# Check if workspace is sourced
if [ -z "$AMENT_PREFIX_PATH" ]; then
echo -e "${RED}Error: ROS2 workspace not sourced!${NC}"
echo "Please run: source install/setup.bash"
exit 1
fi
# Parse arguments
ENABLE_CAMERA="true"
ENABLE_BOARD_DETECTION="true"
ENABLE_OCCUPANCY="true"
ENABLE_CHESS_ENGINE="true"
ENABLE_MANIPULATION="true"
ENABLE_VISUALIZATION="true"
STOCKFISH_SKILL_LEVEL="10"
STOCKFISH_DEPTH="15"
STOCKFISH_TIME_LIMIT="2000"
LOG_LEVEL="debug"
# Help message
show_help() {
echo "Usage: $0 [OPTIONS]"
echo
echo "Options:"
echo " --no-camera Disable camera undistortion node"
echo " --no-board-detection Disable board detection node"
echo " --no-occupancy Disable occupancy detection node"
echo " --no-chess-engine Disable chess engine node"
echo " --no-manipulation Disable manipulation node (robot control)"
echo " --no-visualization Disable ArUco marker visualization"
echo " --skill-level N Set Stockfish skill level (0-20, default: 10)"
echo " --depth N Set Stockfish search depth (default: 15)"
echo " --time-limit N Set Stockfish time limit in ms (default: 2000)"
echo " --log-level [debug|info] Set logging level (default: debug)"
echo " -h, --help Show this help message"
echo
echo "Examples:"
echo " $0 # Launch with default settings"
echo " $0 --skill-level 5 --time-limit 1000 # Easier AI, faster moves"
echo " $0 --no-manipulation # Launch without robot control"
exit 0
}
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--no-camera)
ENABLE_CAMERA="false"
shift
;;
--no-board-detection)
ENABLE_BOARD_DETECTION="false"
shift
;;
--no-occupancy)
ENABLE_OCCUPANCY="false"
shift
;;
--no-chess-engine)
ENABLE_CHESS_ENGINE="false"
shift
;;
--no-visualization)
ENABLE_VISUALIZATION="false"
shift
;;
--no-manipulation)
ENABLE_MANIPULATION="false"
shift
;;
--skill-level)
STOCKFISH_SKILL_LEVEL="$2"
shift 2
;;
--depth)
STOCKFISH_DEPTH="$2"
shift 2
;;
--time-limit)
STOCKFISH_TIME_LIMIT="$2"
shift 2
;;
--log-level)
LOG_LEVEL="$2"
shift 2
;;
-h|--help)
show_help
;;
*)
echo -e "${RED}Error: Unknown option $1${NC}"
echo "Use --help for usage information"
exit 1
;;
esac
done
# Display configuration
echo -e "${GREEN}Launch Configuration:${NC}"
echo " Camera undistortion: $ENABLE_CAMERA"
echo " Board detection: $ENABLE_BOARD_DETECTION"
echo " Occupancy detection: $ENABLE_OCCUPANCY"
echo " Chess engine: $ENABLE_CHESS_ENGINE"
echo " Manipulation: $ENABLE_MANIPULATION"
echo " ArUco visualization: $ENABLE_VISUALIZATION"
echo " Stockfish skill level: $STOCKFISH_SKILL_LEVEL"
echo " Stockfish depth: $STOCKFISH_DEPTH"
echo " Stockfish time limit: ${STOCKFISH_TIME_LIMIT}ms"
echo " Log level: $LOG_LEVEL"
echo
# Launch the system
echo -e "${BLUE}Launching vertical chess system...${NC}"
echo
ros2 launch vertical_chess vertical_chess.launch.py \
enable_camera:=$ENABLE_CAMERA \
enable_board_detection:=$ENABLE_BOARD_DETECTION \
enable_occupancy_detection:=$ENABLE_OCCUPANCY \
enable_chess_engine:=$ENABLE_CHESS_ENGINE \
enable_manipulation:=$ENABLE_MANIPULATION \
enable_visualization:=$ENABLE_VISUALIZATION \
stockfish_skill_level:=$STOCKFISH_SKILL_LEVEL \
stockfish_depth:=$STOCKFISH_DEPTH \
log_level:=$LOG_LEVEL \
stockfish_time_limit_ms:=$STOCKFISH_TIME_LIMIT