From 53d92c956d6652831fe1010e12ec2775584af81d Mon Sep 17 00:00:00 2001 From: MagDish <2717360869@qq.com> Date: Wed, 13 Nov 2024 17:06:40 +0800 Subject: [PATCH] new change_target --- scripts/gyms/sprint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/gyms/sprint.py b/scripts/gyms/sprint.py index 645d41a..1d45f9f 100644 --- a/scripts/gyms/sprint.py +++ b/scripts/gyms/sprint.py @@ -350,9 +350,12 @@ class sprint(gym.Env): direction_error = abs(self.walk_rel_orientation) direction_error = min(direction_error, 10) reward = robot_speed * (1 - direction_error / 10) + if np.linalg.norm(r.loc_torso_position[:2] - self.walk_rel_target,ord='fro') < 1: + reward += 50 + if self.player.behavior.is_ready("Get_Up"): self.terminal = True - elif w.time_local_ms - self.reset_time > 50000: + elif w.time_local_ms - self.reset_time > 40000: self.terminal = True elif r.loc_torso_position[0] > 14.5: self.terminal = True