@@ -11,7 +11,7 @@ def __init__(self, match):
11
11
self .g_left = 0.87
12
12
self .g_right = 0.46
13
13
14
- self .gk_x = 0.1
14
+ self .gk_x = 0.12
15
15
16
16
def start (self , robot = None ):
17
17
super ().start (robot = robot )
@@ -73,21 +73,21 @@ def get_def_spot(m):
73
73
# trava o goleiro na lateral do gol caso a bola esteja no escanteio ou
74
74
# acima/abaixo da linha do gol e indo para o escanteio
75
75
if (m .ball .y > g_cvr_sup and m .ball .y > ga_hgr ) or (m .ball .y > ga_hgr ):
76
- y = g_hgr + self . robot_w / 4
76
+ y = g_hgr
77
77
return (x , y )
78
78
79
79
elif (m .ball .y < g_cvr_inf and m .ball .y < ga_lwr ) or (m .ball .y < ga_lwr ):
80
- y = g_lwr - self . robot_w / 4
80
+ y = g_lwr
81
81
return (x , y )
82
82
83
83
# bloqueia uma possivel trajetoria da bola se ela esta no meio do campo indo para a lateral
84
84
if ga_lwr < m .ball .y < ga_hgr :
85
85
y = m .ball .y + m .ball .vy * (16 / self .fps )
86
86
87
87
if y > g_hgr :
88
- y = g_hgr + self . robot_w / 4
88
+ y = g_hgr
89
89
elif y < g_lwr :
90
- y = g_lwr - self . robot_w / 4
90
+ y = g_lwr
91
91
92
92
return (x , y )
93
93
@@ -142,7 +142,7 @@ def get_def_spot(m):
142
142
143
143
self .repel = algorithms .fields .LineField (
144
144
self .match ,
145
- target = (- .03 , 0.65 ),
145
+ target = (- .025 , 0.65 ),
146
146
theta = math .pi / 2 ,
147
147
line_size = 1.3 ,
148
148
line_dist = 0.07 ,
@@ -151,18 +151,15 @@ def get_def_spot(m):
151
151
multiplier = 1
152
152
)
153
153
154
- def get_def_pos_denovo (m ):
155
- x , y = get_def_spot (m )
156
- print ("DEF POS: " , x , y )
157
- return x ,y
154
+ self .get_pos = get_def_spot
158
155
159
156
self .pebas .add_field (
160
157
algorithms .fields .LineField (
161
158
self .match ,
162
- target = get_def_pos_denovo ,
159
+ target = get_def_spot ,
163
160
theta = 0 ,
164
161
line_size = 1 ,
165
- line_dist = 0.2 ,
162
+ line_dist = 0.1 ,
166
163
multiplier = .7 ,
167
164
decay = lambda x : x ** 4
168
165
)
@@ -194,15 +191,15 @@ def get_def_pos_denovo(m):
194
191
target = lambda m : (self .gk_x , m .ball .y ),
195
192
radius = 0.1 ,
196
193
decay = lambda x : x ** 2 ,
197
- multiplier = 0.8
194
+ multiplier = 0.7
198
195
)
199
196
)
200
197
201
198
self .recovery .add_field (
202
199
algorithms .fields .PointField (
203
200
self .match ,
204
201
target = (self .gk_x , .65 ),
205
- radius = 0.25 ,
202
+ radius = 0.15 ,
206
203
decay = lambda x : x ** 3 ,
207
204
multiplier = 0.8
208
205
)
@@ -237,10 +234,10 @@ def decide(self):
237
234
238
235
if not self .g_right < ball .y < self .g_left and ball .x < .15 :
239
236
behaviour = self .push_ball
240
- elif ball .y > self .g_left :
241
- behaviour = self .left_edge
242
- elif ball .y < self .g_right :
243
- behaviour = self .right_edge
237
+ # elif ball.y > self.g_left:
238
+ # behaviour = self.left_edge
239
+ # elif ball.y < self.g_right:
240
+ # behaviour = self.right_edge
244
241
else :
245
242
behaviour = self .pebas
246
243
@@ -250,6 +247,7 @@ def decide(self):
250
247
# print(self.robot.y)
251
248
252
249
# print(self.robot.is_visible())
250
+ print (behaviour .name )
253
251
return behaviour .compute ([self .robot .x , self .robot .y ])
254
252
255
253
# def update(self):
0 commit comments