|
|
@ -259,6 +259,7 @@ class dribble(gym.Env):
|
|
|
|
def close(self):
|
|
|
|
def close(self):
|
|
|
|
Draw.clear_all()
|
|
|
|
Draw.clear_all()
|
|
|
|
self.player.terminate()
|
|
|
|
self.player.terminate()
|
|
|
|
|
|
|
|
|
|
|
|
def execute(self, action):
|
|
|
|
def execute(self, action):
|
|
|
|
|
|
|
|
|
|
|
|
# Actions:
|
|
|
|
# Actions:
|
|
|
@ -354,7 +355,7 @@ class dribble(gym.Env):
|
|
|
|
loss = self.loss(obs, action_p, action_r)
|
|
|
|
loss = self.loss(obs, action_p, action_r)
|
|
|
|
|
|
|
|
|
|
|
|
# 计算奖励
|
|
|
|
# 计算奖励
|
|
|
|
reward = np.linalg.norm(w.ball_cheat_abs_vel) * cos_theta
|
|
|
|
reward = np.linalg.norm(w.ball_cheat_abs_vel) * cos_theta + loss
|
|
|
|
|
|
|
|
|
|
|
|
if self.ball_dist_hip_center_2d < 0.115:
|
|
|
|
if self.ball_dist_hip_center_2d < 0.115:
|
|
|
|
reward = 0
|
|
|
|
reward = 0
|
|
|
|