diff --git a/scripts/gyms/sprint.py b/scripts/gyms/sprint.py index 1d1b0c1..93163c3 100644 --- a/scripts/gyms/sprint.py +++ b/scripts/gyms/sprint.py @@ -291,6 +291,8 @@ class sprint(gym.Env): dir_y = (y - self.Gen_player_pos[1]) / abs (y - self.Gen_player_pos[1]) x = x + 5 * dir_x y = y + 5 * dir_y + x = np.clip(x, -15, 15) + y = np.clip(y, -15, 15) self.walk_target = np.array([x, y]) def step(self, action): @@ -341,7 +343,7 @@ class sprint(gym.Env): direction_error = abs(self.walk_rel_orientation) direction_error = min(direction_error, 10) reward = robot_speed * (1.5 - direction_error / 10) - if self.walk_distance < 1: + if self.walk_distance < 0.5: reward += 20 self.generate_random_target()