summaryrefslogtreecommitdiff
path: root/examples/pybullet/gym/pybullet_envs/examples/runServer.py
blob: bcd95f81217ab800d3d3ed40fa42bf2a206edc37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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):
	#this is a no-op command, to allow GUI updates on Mac OSX (main thread)
	p.setPhysicsEngineParameter()
	time.sleep(0.01)