new
This commit is contained in:
parent
a5a55c10b7
commit
8dd76d0494
@ -291,6 +291,8 @@ class sprint(gym.Env):
|
|||||||
dir_y = (y - self.Gen_player_pos[1]) / abs (y - self.Gen_player_pos[1])
|
dir_y = (y - self.Gen_player_pos[1]) / abs (y - self.Gen_player_pos[1])
|
||||||
x = x + 5 * dir_x
|
x = x + 5 * dir_x
|
||||||
y = y + 5 * dir_y
|
y = y + 5 * dir_y
|
||||||
|
x = np.clip(x, -15, 15)
|
||||||
|
y = np.clip(y, -15, 15)
|
||||||
self.walk_target = np.array([x, y])
|
self.walk_target = np.array([x, y])
|
||||||
def step(self, action):
|
def step(self, action):
|
||||||
|
|
||||||
@ -341,7 +343,7 @@ class sprint(gym.Env):
|
|||||||
direction_error = abs(self.walk_rel_orientation)
|
direction_error = abs(self.walk_rel_orientation)
|
||||||
direction_error = min(direction_error, 10)
|
direction_error = min(direction_error, 10)
|
||||||
reward = robot_speed * (1.5 - direction_error / 10)
|
reward = robot_speed * (1.5 - direction_error / 10)
|
||||||
if self.walk_distance < 1:
|
if self.walk_distance < 0.5:
|
||||||
reward += 20
|
reward += 20
|
||||||
self.generate_random_target()
|
self.generate_random_target()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user