From 3f00c7bd49e395970ca40885e0dc43f149bcf239 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 27 Aug 2017 19:53:38 -0700 Subject: [PATCH] small tweak in vr_kuka_setup.py example --- .../gym/pybullet_envs/examples/vr_kuka_setup.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/pybullet/gym/pybullet_envs/examples/vr_kuka_setup.py b/examples/pybullet/gym/pybullet_envs/examples/vr_kuka_setup.py index 39403b97e..38d32b844 100644 --- a/examples/pybullet/gym/pybullet_envs/examples/vr_kuka_setup.py +++ b/examples/pybullet/gym/pybullet_envs/examples/vr_kuka_setup.py @@ -1,8 +1,9 @@ import pybullet as p -#p.connect(p.UDP,"192.168.86.100") +import time import pybullet_data +#cid = p.connect(p.UDP,"192.168.86.100") cid = p.connect(p.SHARED_MEMORY) if (cid<0): p.connect(p.GUI) @@ -80,7 +81,12 @@ for jointIndex in range (p.getNumJoints(ob)): p.setGravity(0.000000,0.000000,0.000000) p.setGravity(0,0,-10) -for i in range (100000): - p.stepSimulation() +p.setRealTimeSimulation(1) +ref_time = time.time() + +running_time = 60 # seconds +while (time.time() < ref_time+running_time): + p.setGravity(0,0,-10) + #p.stepSimulation() p.disconnect()