Fix for 1643, allow to instantiate multiple PyBullet Gym environments (Ant, Humanoid, Hopper, Pendula etc) in the same process (same or other thread). It uses the pybullet_utils.bullet_client to achieve this.
This commit is contained in:
@@ -6,7 +6,8 @@ class InvertedPendulum(MJCFBasedRobot):
|
||||
def __init__(self):
|
||||
MJCFBasedRobot.__init__(self, 'inverted_pendulum.xml', 'cart', action_dim=1, obs_dim=5)
|
||||
|
||||
def robot_specific_reset(self):
|
||||
def robot_specific_reset(self, bullet_client):
|
||||
self._p = bullet_client
|
||||
self.pole = self.parts["pole"]
|
||||
self.slider = self.jdict["slider"]
|
||||
self.j1 = self.jdict["hinge"]
|
||||
@@ -55,7 +56,8 @@ class InvertedDoublePendulum(MJCFBasedRobot):
|
||||
def __init__(self):
|
||||
MJCFBasedRobot.__init__(self, 'inverted_double_pendulum.xml', 'cart', action_dim=1, obs_dim=9)
|
||||
|
||||
def robot_specific_reset(self):
|
||||
def robot_specific_reset(self, bullet_client):
|
||||
self._p = bullet_client
|
||||
self.pole2 = self.parts["pole2"]
|
||||
self.slider = self.jdict["slider"]
|
||||
self.j1 = self.jdict["hinge"]
|
||||
|
||||
Reference in New Issue
Block a user