mirror of
https://github.com/wassname/kair_algorithms_draft.git
synced 2026-09-09 11:25:10 +08:00
Fix episode never ending issue (#88)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user