diff --git a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py index 795962a..17485b3 100755 --- a/scripts/envs/open_manipulator/open_manipulator_reacher_env.py +++ b/scripts/envs/open_manipulator/open_manipulator_reacher_env.py @@ -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):