Fix episode never ending issue (#88)

This commit is contained in:
Whi Kwon
2019-07-25 22:57:08 +09:00
committed by GitHub
parent ede6fa3c7a
commit 1b733a9f4c
@@ -78,16 +78,15 @@ class OpenManipulatorReacherEnv(gym.Env):
# TODO: Add termination condition
# if self.ros_interface.check_for_termination():
# self.done = True
if self.ros_interface.check_for_success():
if (
self.ros_interface.check_for_success()
or self.episode_steps == self._max_episode_steps
):
self.done = True
self.episode_steps = 0
obs = self.ros_interface.get_observation()
if self.episode_steps == self._max_episode_steps:
self.done = False
self.episode_steps = 0
return obs, self.reward_rescale_ratio * self.reward, self.done, None
def reset(self):