mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
a9455ce891
that accepts SHARED_MEMORY connections. Handy if you run a pybullet_envs Gym environment and want to visualize it. By default, bullet_client will try to connect to a shared memory connection first.
19 lines
571 B
Python
19 lines
571 B
Python
#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)
|