From 051d167c83b42ed854a4fac092af56515eaa9571 Mon Sep 17 00:00:00 2001 From: vmoens Date: Tue, 7 Nov 2023 15:25:23 -0500 Subject: [PATCH] add reset --- robohive/envs/env_base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/robohive/envs/env_base.py b/robohive/envs/env_base.py index 1ff4a2fc..60ff1f89 100644 --- a/robohive/envs/env_base.py +++ b/robohive/envs/env_base.py @@ -492,8 +492,7 @@ def seed(self, seed=None): def get_input_seed(self): return self.input_seed - - def reset(self, reset_qpos=None, reset_qvel=None, **kwargs): + def _reset(self, reset_qpos=None, reset_qvel=None, **kwargs): """ Reset the environment Default implemention provided. Override if env needs custom reset @@ -502,7 +501,12 @@ def reset(self, reset_qpos=None, reset_qvel=None, **kwargs): qvel = self.init_qvel.copy() if reset_qvel is None else reset_qvel self.robot.reset(qpos, qvel, **kwargs) return self.get_obs() - + @implement_for("gym", None, "0.26") + def reset(self, reset_qpos=None, reset_qvel=None, **kwargs): + return self._reset(reset_qpos=reset_qpos, reset_qvel=reset_qvel, **kwargs) + @implement_for("gym", "0.26", None) + def reset(self, reset_qpos=None, reset_qvel=None, **kwargs): + return self._reset(reset_qpos=reset_qpos, reset_qvel=reset_qvel, **kwargs), {} @property def _step(self, a):