Skip to content

Commit 1b733a9

Browse files
authored
Fix episode never ending issue (#88)
1 parent ede6fa3 commit 1b733a9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/envs/open_manipulator/open_manipulator_reacher_env.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,15 @@ def step(self, action):
7878
# TODO: Add termination condition
7979
# if self.ros_interface.check_for_termination():
8080
# self.done = True
81-
if self.ros_interface.check_for_success():
81+
if (
82+
self.ros_interface.check_for_success()
83+
or self.episode_steps == self._max_episode_steps
84+
):
8285
self.done = True
8386
self.episode_steps = 0
8487

8588
obs = self.ros_interface.get_observation()
8689

87-
if self.episode_steps == self._max_episode_steps:
88-
self.done = False
89-
self.episode_steps = 0
90-
9190
return obs, self.reward_rescale_ratio * self.reward, self.done, None
9291

9392
def reset(self):

0 commit comments

Comments
 (0)