use SHARED_MEMORY as first connection attempt, to make visualization/OpenGL rendering easier
This commit is contained in:
@@ -8,7 +8,9 @@ class BulletClient(object):
|
||||
|
||||
def __init__(self, connection_mode=pybullet.DIRECT):
|
||||
"""Create a simulation and connect to it."""
|
||||
self._client = pybullet.connect(connection_mode)
|
||||
self._client = pybullet.connect(pybullet.SHARED_MEMORY)
|
||||
if(self._client<0):
|
||||
self._client = pybullet.connect(connection_mode)
|
||||
self._shapes = {}
|
||||
|
||||
def __del__(self):
|
||||
|
||||
@@ -37,7 +37,9 @@ class KukaGymEnv(gym.Env):
|
||||
self.terminated = 0
|
||||
self._p = p
|
||||
if self._renders:
|
||||
p.connect(p.GUI)
|
||||
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])
|
||||
else:
|
||||
p.connect(p.DIRECT)
|
||||
|
||||
@@ -166,6 +166,9 @@ class MinitaurBulletEnv(gym.Env):
|
||||
def set_env_randomizer(self, env_randomizer):
|
||||
self._env_randomizer = env_randomizer
|
||||
|
||||
def configure(self, args):
|
||||
self._args = args
|
||||
|
||||
def _reset(self):
|
||||
if self._hard_reset:
|
||||
self._pybullet_client.resetSimulation()
|
||||
|
||||
Reference in New Issue
Block a user