Skip to content

Commit

Permalink
Rollback to some state stanfordnmbl#79
Browse files Browse the repository at this point in the history
  • Loading branch information
kidzik committed Dec 21, 2017
1 parent 5cc1f30 commit db2f0c1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test.rollback.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from osim.env import RunEnv
import opensim

env = RunEnv(visualize=True)
observation = env.reset(seed=0)

s = 0
for s in range(50000):
d = False

if s == 30:
state_old = opensim.State(env.osim_model.state)
print("State stored")
print(state_old)
if s % 50 == 49:
env.osim_model.revert(state_old)
state_old = opensim.State(state_old)
print("Rollback")
print(state_old)

o, r, d, i = env.step(env.action_space.sample())

0 comments on commit db2f0c1

Please sign in to comment.