From 105c2c948f20c408c469adc517d15762585e10e3 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 11 Sep 2017 09:38:55 -0700 Subject: [PATCH] add simple 'runServer.py' script, that lets you run a GUI shared memory server to connect to --- .../gym/pybullet_envs/examples/runServer.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/pybullet/gym/pybullet_envs/examples/runServer.py diff --git a/examples/pybullet/gym/pybullet_envs/examples/runServer.py b/examples/pybullet/gym/pybullet_envs/examples/runServer.py new file mode 100644 index 000000000..8c37caa9d --- /dev/null +++ b/examples/pybullet/gym/pybullet_envs/examples/runServer.py @@ -0,0 +1,18 @@ +#add parent dir to find package. Only needed for source code build, pip install doesn't need it. +import os +import inspect +currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(os.path.dirname(currentdir)) +os.sys.path.insert(0,parentdir) + +import pybullet_data +import pybullet as p +import time + +p.connect(p.GUI_SERVER) +p.setAdditionalSearchPath(pybullet_data.getDataPath()) + +while(1): + time.sleep(0.01) + p.getNumBodies() +