Skip to content

Commit

Permalink
add reset
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored and vikashplus committed Nov 18, 2023
1 parent 2b6a164 commit 051d167
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions robohive/envs/env_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 051d167

Please sign in to comment.