mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
deep_mimic: replace retrained backflip policy
This commit is contained in:
parent
6c73aa1e12
commit
2e85490b6b
Binary file not shown.
Binary file not shown.
@ -1,3 +1,4 @@
|
|||||||
|
import time
|
||||||
import os
|
import os
|
||||||
import inspect
|
import inspect
|
||||||
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||||
@ -17,7 +18,7 @@ import random
|
|||||||
|
|
||||||
update_timestep = 1. / 240.
|
update_timestep = 1. / 240.
|
||||||
animating = True
|
animating = True
|
||||||
|
step = False
|
||||||
|
|
||||||
def update_world(world, time_elapsed):
|
def update_world(world, time_elapsed):
|
||||||
timeStep = update_timestep
|
timeStep = update_timestep
|
||||||
@ -82,11 +83,15 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
world = build_world(args, True)
|
world = build_world(args, True)
|
||||||
while (world.env._pybullet_client.isConnected()):
|
while (world.env._pybullet_client.isConnected()):
|
||||||
|
|
||||||
timeStep = update_timestep
|
timeStep = update_timestep
|
||||||
|
time.sleep(timeStep)
|
||||||
keys = world.env.getKeyboardEvents()
|
keys = world.env.getKeyboardEvents()
|
||||||
|
|
||||||
if world.env.isKeyTriggered(keys, ' '):
|
if world.env.isKeyTriggered(keys, ' '):
|
||||||
animating = not animating
|
animating = not animating
|
||||||
if (animating):
|
if world.env.isKeyTriggered(keys, 'i'):
|
||||||
|
step = True
|
||||||
|
if (animating or step):
|
||||||
update_world(world, timeStep)
|
update_world(world, timeStep)
|
||||||
#animating=False
|
step = False
|
||||||
|
Loading…
Reference in New Issue
Block a user