forked from RoboCup-Humanoid-TC/hlvs_webots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobocupGoal.proto
267 lines (266 loc) · 7.92 KB
/
RobocupGoal.proto
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#VRML_SIM R2022b utf8
# license: Apache License 2.0
# license url: http://www.apache.org/licenses/LICENSE-2.0
# Robocup Humanoid League 2021 soccer goal.
# The color and size of the goal can be modified.
# template language: javascript
PROTO RobocupGoal [
field SFVec3f translation 0 0 0
field SFRotation rotation 0 1 0 0
field SFString name "robotstadium goal"
field SFColor netColor 0.3 0.3 0.3 # Defines the color of the net.
field SFString{"adult", "kid"} size "kid" # Defines the size of the field.
]
{
%<
// Official soccer field dimensions from RoboCup 2021 (in meters)
let C, D, goal_height;
if (fields.size.value === 'kid') {
// KidSize dimensions
C = 0.6;
D = 2.6;
goal_height = 1.2;
} else {
// AdultSize dimensions
C = 0.6;
D = 2.6;
goal_height = 1.8;
}
const post_radius = 0.05; // Diameter/width/depth must be between 0.08-0.12
const post_spacing = D + 2 * post_radius;
const post_height = goal_height + post_radius;
const backpost_radius = 0.02; // Not defined in rules
const bounding_object_thickness_sides = 2 * backpost_radius; // Not defined in rules
const bounding_object_thickness_back = 0.3; // Not defined in rules
>%
Solid {
translation IS translation
rotation IS rotation
locked TRUE
children [
DEF HORIZONTAL_POST_TRANS Transform {
translation 0 0 %<= post_height >%
rotation 0 1 0 1.5708
children [
Shape {
appearance DEF POST_APP PBRAppearance {
baseColor 1 1 1
metalness 0
roughness 0.2
}
geometry Capsule {
height %<= post_spacing >%
radius %<= post_radius >%
}
}
]
}
DEF RIGHT_POST_TRANS Transform {
translation %<= -post_spacing / 2 >% 0 %<= post_height / 2 >%
rotation 1 0 0 0
children [
Shape {
appearance USE POST_APP
geometry Cylinder {
bottom FALSE
top FALSE
height %<= post_height >%
radius %<= post_radius >%
}
}
]
}
DEF LEFT_POST_TRANS Transform {
translation %<= post_spacing / 2 >% 0 %<= post_height / 2 >%
rotation 1 0 0 0
children [
Shape {
appearance USE POST_APP
geometry Cylinder {
bottom FALSE
top FALSE
height %<= post_height >%
radius %<= post_radius >%
}
}
]
}
Shape {
appearance DEF NET_APP PBRAppearance {
baseColor IS netColor
baseColorMap ImageTexture {
url "textures/net.png"
filtering 0
}
metalness 0
roughness 1
}
geometry IndexedFaceSet {
coord Coordinate {
point [
%<= -post_spacing / 2 >% %<= -C >% 0
%<= post_spacing / 2 >% %<= -C >% 0
%<= post_spacing / 2 >% %<= -C >% %<= post_height >%
%<= -post_spacing / 2 >% %<= -C >% %<= post_height >%
%<= post_spacing / 2 >% %<= -post_radius >% 0
%<= -post_spacing / 2 >% %<= -post_radius >% 0
%<= post_spacing / 2 >% %<= -post_radius >% %<= post_height >%
%<= -post_spacing / 2 >% %<= -post_radius >% %<= post_height >%
]
}
texCoord TextureCoordinate {
point [
0 0
28 0
28 16
0 16
7 0
7 16
0 16
28 0
28 6
0 6
]
}
coordIndex [
0, 1, 2, 3, -1,
3, 2, 1, 0, -1,
1, 4, 6, 2, -1,
2, 6, 4, 1, -1,
0, 5, 7, 3, -1,
3, 7, 5, 0, -1,
2, 3, 7, 6, -1,
6, 7, 3, 2, -1
]
texCoordIndex [
0, 1, 2, 3, -1,
0, 1, 2, 3, -1,
0, 4, 5, 6, -1,
0, 4, 5, 6, -1,
0, 4, 5, 6, -1,
0, 4, 5, 6, -1,
0, 7, 8, 9, -1,
0, 7, 8, 9, -1
]
}
}
Transform {
translation 0 %<= -C >% %<= post_height >%
rotation 0 1 0 1.5708
children [
DEF SMALL_HORIZONTAL_POST_SHAPE Shape {
appearance USE POST_APP
geometry Capsule {
height %<= post_spacing >%
radius %<= backpost_radius >%
}
}
]
}
Transform {
translation 0 %<= -C >% %<= backpost_radius / 2 >%
rotation 0 1 0 1.5708
children [
USE SMALL_HORIZONTAL_POST_SHAPE
]
}
Transform {
translation %<= post_spacing / 2 >% %<= -C >% %<= post_height / 2 >%
rotation 1 0 0 0
children [
DEF SMALL_POST_SHAPE Shape {
appearance USE POST_APP
geometry Cylinder {
bottom FALSE
top FALSE
height %<= post_height >%
radius %<= backpost_radius >%
}
}
]
}
Transform {
translation %<= -post_spacing / 2 >% %<= -C >% %<= post_height / 2 >%
rotation 1 0 0 0.0
children [
USE SMALL_POST_SHAPE
]
}
Transform {
translation %<= post_spacing / 2 >% %<= -C / 2 >% %<= post_height >%
rotation 1 0 0 1.5708
children [
DEF OTHER_SMALL_POST_SHAPE Shape {
appearance USE POST_APP
geometry Cylinder {
bottom FALSE
top FALSE
height %<= C >%
radius %<= backpost_radius >%
}
}
]
}
Transform {
translation %<= -post_spacing / 2 >% %<= -C / 2 >% %<= post_height >%
rotation 1 0 0 1.5708
children [
USE OTHER_SMALL_POST_SHAPE
]
}
Transform {
translation %<= post_spacing / 2 >% %<= -C / 2 >% %<= backpost_radius / 2 >%
rotation 1 0 0 1.5708
children [
USE OTHER_SMALL_POST_SHAPE
]
}
Transform {
translation %<= -post_spacing / 2 >% %<= -C / 2 >% %<= backpost_radius / 2 >%
rotation 1 0 0 1.5708
children [
USE OTHER_SMALL_POST_SHAPE
]
}
]
name IS name
model "robotstadium goal"
boundingObject Group {
children [
USE HORIZONTAL_POST_TRANS
USE RIGHT_POST_TRANS
USE LEFT_POST_TRANS
Transform { # Left
translation %<= -post_spacing / 2 >% %<= -post_radius - (C - post_radius) / 2 >% %<= (post_height - backpost_radius) / 2 >%
children [
DEF GOAL_SIDE_BOX Box {
size %<= bounding_object_thickness_sides >% %<= C - post_radius >% %<= post_height - backpost_radius >%
}
]
}
Transform { # Right
translation %<= post_spacing / 2 >% %<= -post_radius - (C - post_radius) / 2 >% %<= (post_height - backpost_radius) / 2 >%
children [
USE GOAL_SIDE_BOX
]
}
Transform { # Back
translation 0 %<= -C - bounding_object_thickness_back / 2 >% %<= (post_height+backpost_radius) / 2 >%
children [
Box {
size %<= post_spacing + 2 * backpost_radius >% %<= bounding_object_thickness_back >% %<= post_height + backpost_radius >%
}
]
}
Transform { # Top
translation 0 %<= -post_radius - (C - post_radius) / 2 >% %<= post_height >%
children [
Box {
size %<= post_spacing + 2 * backpost_radius >% %<= C - post_radius >% %<= bounding_object_thickness_sides >%
}
]
}
]
}
}
}