re-enable shared memory connection for pybullet Gym envs (with fallback to GUI or DIRECT)
suppress shared memory connection warnings add fallback from ER_BULLET_HARDWARE_OPENGL to TinyRenderer if not available
This commit is contained in:
@@ -8,7 +8,7 @@ class BulletClient(object):
|
||||
|
||||
def __init__(self, connection_mode=pybullet.DIRECT):
|
||||
"""Create a simulation and connect to it."""
|
||||
self._client = -1 #pybullet.connect(pybullet.SHARED_MEMORY)
|
||||
self._client = pybullet.connect(pybullet.SHARED_MEMORY)
|
||||
if(self._client<0):
|
||||
self._client = pybullet.connect(connection_mode)
|
||||
self._shapes = {}
|
||||
|
||||
@@ -40,7 +40,9 @@ class KukaCamGymEnv(gym.Env):
|
||||
self.terminated = 0
|
||||
self._p = p
|
||||
if self._renders:
|
||||
p.connect(p.GUI)
|
||||
cid = p.connect(p.SHARED_MEMORY)
|
||||
if (cid<0):
|
||||
p.connect(p.GUI)
|
||||
p.resetDebugVisualizerCamera(1.3,180,-41,[0.52,-0.2,-0.33])
|
||||
else:
|
||||
p.connect(p.DIRECT)
|
||||
|
||||
@@ -37,7 +37,7 @@ class KukaGymEnv(gym.Env):
|
||||
self.terminated = 0
|
||||
self._p = p
|
||||
if self._renders:
|
||||
cid = -1 #p.connect(p.SHARED_MEMORY)
|
||||
cid = p.connect(p.SHARED_MEMORY)
|
||||
if (cid<0):
|
||||
cid = p.connect(p.GUI)
|
||||
p.resetDebugVisualizerCamera(1.3,180,-41,[0.52,-0.2,-0.33])
|
||||
|
||||
Reference in New Issue
Block a user