-
Notifications
You must be signed in to change notification settings - Fork 0
/
Defines.h
216 lines (179 loc) · 6.14 KB
/
Defines.h
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#ifndef DEFINES_H
#define DEFINES_H
//#define HUMANOID
#define SPL
#define M2CM 100
#define CM2M 0.01
#define VGA
#define WIDTH_VGA 640
#define HEIGHT_VGA 480
#define WIDTH_QVGA 320
#define HEIGHT_QVGA 240
#ifdef VGA
#define WIDTH WIDTH_VGA
#define HEIGHT HEIGHT_VGA
#elif defined(QVGA)
#define WIDTH WIDTH_QVGA
#define HEIGHT HEIGHT_QVGA
#else
#error("NO IMAGE SIZE SPECIFIED")
#endif
enum CAMERAPOSITION{TOP_LEFT=0,TOP_MIDDLE,TOP_RIGHT,BOTTOM_LEFT,BOTTOM_MIDDLE,BOTTOM_RIGHT,POSITION_NUMBER};
enum ObjectId{UNKNOWN_OBJECT,BLUE_ROBOT,RED_ROBOT,BLACK_ROBOT,WHITE_ROBOT,ORANGE_BALL,GREEN_FIELD,REFEREE,NumberObjectID};
enum ObjectGuess{BALL_FIELD,ROBOT,REFEREE_GUESS};
#define SCALE 0.7
#define LINE_WIDTH_PIX 10 * SCALE
#define HUMANOID_FIELD_BORDER_M 0.7
#define HUMANOID_FIELD_WIDTH_M 6.0
#define HUMANOID_FIELD_HEIGHT_M 4.0
#define HUMANOID_CIRCLE_RADIUS_CM 60
#define SPL_FIELD_BORDER_M 0.7
#define SPL_FIELD_WIDTH_M 9.0
#define SPL_FIELD_HEIGHT_M 6.0
#define SPL_CIRCLE_RADIUS_CM 75
#ifdef SPL
#define FIELD_BORDER_M SPL_FIELD_BORDER_M
#define FIELD_WIDTH_M SPL_FIELD_WIDTH_M
#define FIELD_HEIGHT_M SPL_FIELD_HEIGHT_M
#define CIRCLE_RADIUS_CM SPL_CIRCLE_RADIUS_CM
#elif defined(HUMANOID)
#define FIELD_BORDER_M HUMANOID_FIELD_BORDER_M
#define FIELD_WIDTH_M HUMANOID_FIELD_WIDTH_M
#define FIELD_HEIGHT_M HUMANOID_FIELD_HEIGHT_M
#define CIRCLE_RADIUS_CM HUMANOID_CIRCLE_RADIUS_CM
#else
#error("NO FIELD SPECIFIED")
#endif
#define FIELD_WIDTH (FIELD_WIDTH_M*M2CM*SCALE)
#define FIELD_HEIGHT (FIELD_HEIGHT_M*M2CM*SCALE)
#define FIELD_BORDER (FIELD_BORDER_M*M2CM*SCALE)
#define TOTAL_FIELD_WIDTH ((FIELD_WIDTH+FIELD_BORDER*2))
#define TOTAL_FIELD_HEIGHT ((FIELD_HEIGHT+FIELD_BORDER*2))
#define CENTER_X (FIELD_BORDER+FIELD_WIDTH/2)
#define CENTER_Y (FIELD_BORDER+FIELD_HEIGHT/2)
#define CIRCLE_RADIUS_PIX (CIRCLE_RADIUS_CM * SCALE)
#define ROBOT_SIZE_PIX 10
#define ROBOT_WIDTH_PIX 3
#define BALL_SIZE_PIX 5
#define BALL_WIDTH_PIX BALL_SIZE_PIX
#define DARWIN_WIDTH_M 0.25
#define DARWIN_DEPTH_M 0.08
#define NAO_WIDTH_M 0.15
#define NAO_DEPTH_M 0.08
#define PRINT_DEBUG cout<< "FILE : " << __FILE__ <<"LINE: " << __LINE__ << endl;
#define RED_H 0
#define RED_S 100
#define RED_V 50
#define BLUE_H 230
#define BLUE_S 100
#define BLUE_V 50
#define GREEN_S 120
#define GREEN_H 180
#define GREEN_V 50
#define ORANGE_H 30
#define ORANGE_S 100
#define ORANGE_V 50
#define HUE_THRESHOLD 40
#define UPPER_S 100
#define LOWER_S 0
#define UPPER_L 100
#define LOWER_L 0
#define DARWIN_TORSO_MIN_HEIGHT 0.15
#define DARWIN_TORSO_MAX_HEIGHT 0.39
#define DARWIN_MAX_ROBOT_HEIGHT_M 0.7
#define DARWIN_MIN_ROBOT_HEIGHT_M 0.2
#define DARWIN_MAX_POINTCLOUD_DIST 6
#define DARWIN_ON_THE_FIELD_THRESHOLD 0.15
#define NAO_TORSO_MIN_HEIGHT 0.3
#define NAO_TORSO_MAX_HEIGHT 0.55
#define NAO_MAX_ROBOT_HEIGHT_M 0.66
#define NAO_MIN_ROBOT_HEIGHT_M 0.2
#define NAO_MAX_POINTCLOUD_DIST 6
#define NAO_ON_THE_FIELD_THRESHOLD 0.10
#ifdef SPL
#define TORSO_MIN_HEIGHT NAO_TORSO_MIN_HEIGHT
#define TORSO_MAX_HEIGHT NAO_TORSO_MAX_HEIGHT
#define MAX_ROBOT_HEIGHT_M NAO_MAX_ROBOT_HEIGHT_M
#define MIN_ROBOT_HEIGHT_M NAO_MIN_ROBOT_HEIGHT_M
#define MAX_POINTCLOUD_DIST NAO_MAX_POINTCLOUD_DIST
#define ON_THE_FIELD_THRESHOLD NAO_ON_THE_FIELD_THRESHOLD
#elif defined(HUMANOID)
#define TORSO_MIN_HEIGHT DARWIN_TORSO_MIN_HEIGHT
#define TORSO_MAX_HEIGHT DARWIN_TORSO_MAX_HEIGHT
#define MAX_ROBOT_HEIGHT_M DARWIN_MAX_ROBOT_HEIGHT_M
#define MIN_ROBOT_HEIGHT_M DARWIN_MIN_ROBOT_HEIGHT_M
#define MAX_POINTCLOUD_DIST DARWIN_MAX_POINTCLOUD_DIST
#define ON_THE_FIELD_THRESHOLD DARWIN_ON_THE_FIELD_THRESHOLD
#else
#error("NO FIELD SPECIFIED")
#endif
#define BALL_CLUSTER_THRESHOLD 0.08
#define ROBOT_CLUSTER_THRESHOLD 0.2
#define BALL_MIN_POINT_NUM 5
#define BALL_MAX_POINT_NUM 100
#define ROBOT_MIN_POINT_NUM 10
#define ROBOT_MAX_POINT_NUM 40000
#define REFEREE_MIN_POINT_NUM 200
#define FOV_V 45.0f
#define FOV_H 58.0f
#define FIELD_ACTUAL_BORDER_Y_M 1
#define FIELD_ACTUAL_BORDER_X_M 0.3
#define In_THE_FIELD_Y_THRESHOLD (FIELD_WIDTH_M/2.0 /*+ FIELD_ACTUAL_BORDER_Y_M*/)
#define In_THE_FIELD_X_THRESHOLD (FIELD_HEIGHT_M/2.0 /*+ FIELD_ACTUAL_BORDER_X_M*/)
#define CAM_MIN_HEIGHT 0.8
#define MIN_COLOR_PIXELS 3
#define TOP_LEFT_L_FIELD_9X6_X -3
#define TOP_LEFT_L_FIELD_9X6_Y -4.5
#define BOTTOM_RIGHT_L_FIELD_9X6_X 3
#define BOTTOM_RIGHT_L_FIELD_9X6_Y 4.5
#define TOP_RIGHT_L_FIELD_9X6_X -3
#define TOP_RIGHT_L_FIELD_9X6_Y 4.5
#define BOTTOM_LEFT_L_FIELD_9X6_X 3
#define BOTTOM_LEFT_L_FIELD_9X6_Y -4.5
#define TOP_MIDDLE_T_FIELD_9X6_X -3
#define TOP_MIDDLE_T_FIELD_9X6_Y 0
#define TOP_LEFT_L_FIELD_6X4_X -2
#define TOP_LEFT_L_FIELD_6X4_Y -3
#define BOTTOM_RIGHT_L_FIELD_6X4_X 2
#define BOTTOM_RIGHT_L_FIELD_6X4_Y 3
#define TOP_RIGHT_L_FIELD_6X4_X -2
#define TOP_RIGHT_L_FIELD_6X4_Y 3
#define BOTTOM_LEFT_L_FIELD_6X4_X 2
#define BOTTOM_LEFT_L_FIELD_6X4_Y -3
#define TOP_MIDDLE_T_FIELD_6X4_X -2
#define TOP_MIDDLE_T_FIELD_6X4_Y 0
#ifdef HUMANOID
#define TOP_LEFT_L_X TOP_LEFT_L_FIELD_6X4_X
#define TOP_LEFT_L_Y TOP_LEFT_L_FIELD_6X4_Y
#define BOTTOM_RIGHT_L_X BOTTOM_RIGHT_L_FIELD_6X4_X
#define BOTTOM_RIGHT_L_Y BOTTOM_RIGHT_L_FIELD_6X4_Y
#define TOP_RIGHT_L_X TOP_RIGHT_L_FIELD_6X4_X
#define TOP_RIGHT_L_Y TOP_RIGHT_L_FIELD_6X4_Y
#define BOTTOM_LEFT_L_X BOTTOM_LEFT_L_FIELD_6X4_X
#define BOTTOM_LEFT_L_Y BOTTOM_LEFT_L_FIELD_6X4_Y
#define TOP_MIDDLE_T_X TOP_MIDDLE_T_FIELD_6X4_X
#define TOP_MIDDLE_T_Y TOP_MIDDLE_T_FIELD_6X4_Y
#elif defined(SPL)
#define TOP_LEFT_L_X TOP_LEFT_L_FIELD_9X6_X
#define TOP_LEFT_L_Y TOP_LEFT_L_FIELD_9X6_Y
#define BOTTOM_RIGHT_L_X BOTTOM_RIGHT_L_FIELD_9X6_X
#define BOTTOM_RIGHT_L_Y BOTTOM_RIGHT_L_FIELD_9X6_Y
#define TOP_RIGHT_L_X TOP_RIGHT_L_FIELD_9X6_X
#define TOP_RIGHT_L_Y TOP_RIGHT_L_FIELD_9X6_Y
#define BOTTOM_LEFT_L_X BOTTOM_LEFT_L_FIELD_9X6_X
#define BOTTOM_LEFT_L_Y BOTTOM_LEFT_L_FIELD_9X6_Y
#define TOP_MIDDLE_T_X TOP_MIDDLE_T_FIELD_9X6_X
#define TOP_MIDDLE_T_Y TOP_MIDDLE_T_FIELD_9X6_Y
#else
#error("NO FIELD SPECIFIED")
#endif
#ifdef HUMANOID
#define ROBOT_WIDTH_M DARWIN_WIDTH_M
#define ROBOT_DEPTH_M DARWIN_DEPTH_M
#elif defined(SPL)
#define ROBOT_WIDTH_M NAO_WIDTH_M
#define ROBOT_DEPTH_M NAO_DEPTH_M
#else
#error("NO FIELD SPECIFIED")
#endif
#endif // DEFINES_H