@@ -121,7 +121,9 @@ def chuta(self, world):
121
121
return a,b
122
122
123
123
return xb, yb
124
-
124
+ '''
125
+ #Testar ||
126
+ # \/
125
127
if self .gety () > world .FIELD_BOTTOM - distancia_pra_sair_da_parede and (theta_robo > 30 and theta_robo < 150 ):
126
128
b = world .FIELD_BOTTOM - 15
127
129
a = self .getx ()
@@ -138,7 +140,7 @@ def chuta(self, world):
138
140
a = world .FIELD_LEFT + 15
139
141
b = self .gety ()
140
142
return a ,b
141
- '''
143
+
142
144
#Codigo para sair da parede!! : FIM
143
145
144
146
@@ -192,11 +194,11 @@ def controle(self, world):
192
194
xfront , yfront = pd .get_front () #unidade das coordenadas eh cm
193
195
xback , yback = pd .get_back () #unidade das coordenadas eh cm
194
196
pd_x , pd_y = pd .getx () , pd .gety () #unidade das coordenadas eh cm
195
- # xb, yb = world.get_ball().getxy() #unidade das coordenadas eh cm // usada para ver se o zagueiro vai direto para a bola
196
- xb , yb = self .chuta (world ) #Retorna a posicao que o defensor deve ir
197
+ xb , yb = world .get_ball ().getxy () #unidade das coordenadas eh cm // usada para ver se o zagueiro vai direto para a bola
198
+ # xb, yb = self.chuta(world) #Retorna a posicao que o defensor deve ir
197
199
198
200
theta_jog = self .get_theta ()
199
- theta_ball = math .atan2 (yb ,xb ) # unidade rad
201
+ theta_ball = math .atan2 (yb ,xb ) # unidade rad
200
202
theta_gol = math .atan2 (236 ,515 )
201
203
202
204
@@ -230,7 +232,7 @@ def controle(self, world):
230
232
vmax = max (abs (y [0 ][0 ]), abs (y [1 ][0 ])) # paga a maior velocidade
231
233
232
234
#como a velocidade foi parametrizada pela maior, K eh a maior velocidade que a roda pode assumir
233
- K = 150
235
+ K = 100
234
236
vr , vl = y [0 ][0 ]* K / vmax , y [1 ][0 ]* K / vmax #mudei a constante para 255 antes era 100
235
237
236
238
return int (vr ), int (vl )
0 commit comments