deep_mimic: replace retrained backflip policy

This commit is contained in:
Erwin Coumans 2019-07-23 07:27:17 -07:00
parent 6c73aa1e12
commit 2e85490b6b
3 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import time
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
@ -17,7 +18,7 @@ import random
update_timestep = 1. / 240.
animating = True
step = False
def update_world(world, time_elapsed):
timeStep = update_timestep
@ -82,11 +83,15 @@ if __name__ == '__main__':
world = build_world(args, True)
while (world.env._pybullet_client.isConnected()):
timeStep = update_timestep
time.sleep(timeStep)
keys = world.env.getKeyboardEvents()
if world.env.isKeyTriggered(keys, ' '):
animating = not animating
if (animating):
if world.env.isKeyTriggered(keys, 'i'):
step = True
if (animating or step):
update_world(world, timeStep)
#animating=False
step = False