From 0d07ae03b7a3463b2ee5dc2f8d13f8692ce42042 Mon Sep 17 00:00:00 2001 From: kimhc6028 Date: Tue, 23 Jan 2018 18:22:53 +0900 Subject: [PATCH 1/7] [fixed] gym_manipulator_envs typo --- examples/pybullet/gym/pybullet_envs/gym_manipulator_envs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pybullet/gym/pybullet_envs/gym_manipulator_envs.py b/examples/pybullet/gym/pybullet_envs/gym_manipulator_envs.py index 52026925e..2fbf1fdd7 100644 --- a/examples/pybullet/gym/pybullet_envs/gym_manipulator_envs.py +++ b/examples/pybullet/gym/pybullet_envs/gym_manipulator_envs.py @@ -41,7 +41,7 @@ class ReacherBulletEnv(MJCFBaseBulletEnv): class PusherBulletEnv(MJCFBaseBulletEnv): def __init__(self): self.robot = Pusher() - BaseBulletEnv.__init__(self, self.robot) + MJCFBaseBulletEnv.__init__(self, self.robot) def create_single_player_scene(self): return SingleRobotEmptyScene(gravity=9.81, timestep=0.0020, frame_skip=5) @@ -95,7 +95,7 @@ class PusherBulletEnv(MJCFBaseBulletEnv): class StrikerBulletEnv(MJCFBaseBulletEnv): def __init__(self): self.robot = Striker() - BaseBulletEnv.__init__(self, self.robot) + MJCFBaseBulletEnv.__init__(self, self.robot) self._striked = False self._min_strike_dist = np.inf self.strike_threshold = 0.1 @@ -171,7 +171,7 @@ class StrikerBulletEnv(MJCFBaseBulletEnv): class ThrowerBulletEnv(MJCFBaseBulletEnv): def __init__(self): self.robot = Thrower() - BaseBulletEnv.__init__(self, self.robot) + MJCFBaseBulletEnv.__init__(self, self.robot) def create_single_player_scene(self): return SingleRobotEmptyScene(gravity=0.0, timestep=0.0020, frame_skip=5) From c1b5024aea9f975aa604246bdd755d9933b16f29 Mon Sep 17 00:00:00 2001 From: Alexis Breust Date: Thu, 25 Jan 2018 16:37:30 +0100 Subject: [PATCH 2/7] Removed warnings of unused variable in btThreads header --- src/LinearMath/btThreads.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LinearMath/btThreads.h b/src/LinearMath/btThreads.h index 05fd15ec8..cef542329 100644 --- a/src/LinearMath/btThreads.h +++ b/src/LinearMath/btThreads.h @@ -72,6 +72,8 @@ SIMD_FORCE_INLINE void btMutexLock( btSpinMutex* mutex ) { #if BT_THREADSAFE mutex->lock(); +#else + (void)mutex; #endif // #if BT_THREADSAFE } @@ -79,6 +81,8 @@ SIMD_FORCE_INLINE void btMutexUnlock( btSpinMutex* mutex ) { #if BT_THREADSAFE mutex->unlock(); +#else + (void)mutex; #endif // #if BT_THREADSAFE } @@ -87,6 +91,7 @@ SIMD_FORCE_INLINE bool btMutexTryLock( btSpinMutex* mutex ) #if BT_THREADSAFE return mutex->tryLock(); #else + (void)mutex; return true; #endif // #if BT_THREADSAFE } From d3f7a685410a906a5d3a72e1e9e51cdadf6f9ce6 Mon Sep 17 00:00:00 2001 From: Alexis Breust Date: Thu, 25 Jan 2018 16:41:25 +0100 Subject: [PATCH 3/7] Removed warning in btCapsuleShape header --- src/BulletCollision/CollisionShapes/btCapsuleShape.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/src/BulletCollision/CollisionShapes/btCapsuleShape.h index 7d64b46ab..5a3362834 100644 --- a/src/BulletCollision/CollisionShapes/btCapsuleShape.h +++ b/src/BulletCollision/CollisionShapes/btCapsuleShape.h @@ -49,6 +49,7 @@ public: virtual void setMargin(btScalar collisionMargin) { //don't override the margin for capsules, their entire radius == margin + (void)collisionMargin; } virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const From b908b147a678f9850e53caa86431de78e9174191 Mon Sep 17 00:00:00 2001 From: AndreaIncertiDelmonte Date: Fri, 26 Jan 2018 10:09:14 +0100 Subject: [PATCH 4/7] Overwrite of the reset() public funciton in child classes --- examples/pybullet/gym/pybullet_envs/bullet/kukaGymEnv.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/pybullet/gym/pybullet_envs/bullet/kukaGymEnv.py b/examples/pybullet/gym/pybullet_envs/bullet/kukaGymEnv.py index d2a47935d..b9ef16017 100644 --- a/examples/pybullet/gym/pybullet_envs/bullet/kukaGymEnv.py +++ b/examples/pybullet/gym/pybullet_envs/bullet/kukaGymEnv.py @@ -275,3 +275,11 @@ class KukaGymEnv(gym.Env): #print("reward") #print(reward) return reward + + def reset(self): + """Resets the state of the environment and returns an initial observation. + + Returns: observation (object): the initial observation of the + space. + """ + return self._reset() \ No newline at end of file From 3011cf11309e2cd577321858208beea4bcf117e4 Mon Sep 17 00:00:00 2001 From: cedspam Date: Fri, 26 Jan 2018 09:29:39 +0000 Subject: [PATCH 5/7] avoid errors in some ide docs system there are some error linked to repeated import of this module in spyder, an env with the same id cannot be registered again --- examples/pybullet/gym/pybullet_envs/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/pybullet/gym/pybullet_envs/__init__.py b/examples/pybullet/gym/pybullet_envs/__init__.py index a605dafc4..361d8bf42 100644 --- a/examples/pybullet/gym/pybullet_envs/__init__.py +++ b/examples/pybullet/gym/pybullet_envs/__init__.py @@ -1,4 +1,10 @@ -from gym.envs.registration import registry, register, make, spec +import gym +from gym.envs.registration import registry, make, spec +def register(id,*args,**kvargs): + if id inĀ  registry.env_specs: + return + else: + return gym.envs.registration.register(id,*args,**kvargs) # ------------bullet------------- From c41d5759077b38ee104b34dd593b0a1877b443d4 Mon Sep 17 00:00:00 2001 From: CuriousRubick Date: Fri, 26 Jan 2018 10:29:46 -0600 Subject: [PATCH 6/7] early break if single object sleeping --- .../CollisionDispatch/btSimulationIslandManager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index f849e31e3..91c76a8da 100644 --- a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -261,13 +261,11 @@ void btSimulationIslandManager::buildIslands(btDispatcher* dispatcher,btCollisio btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { - if (colObj0->getActivationState()== ACTIVE_TAG) - { - allSleeping = false; - } - if (colObj0->getActivationState()== DISABLE_DEACTIVATION) + if (colObj0->getActivationState()== ACTIVE_TAG || + colObj0->getActivationState()== DISABLE_DEACTIVATION) { allSleeping = false; + break; } } } From ecfdd07f192b57fbe6eb07207950ffbbc82d72e9 Mon Sep 17 00:00:00 2001 From: CuriousRubick Date: Fri, 26 Jan 2018 10:31:00 -0600 Subject: [PATCH 7/7] early break if single object sleeping --- .../Dynamics/btSimulationIslandManagerMt.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp b/src/BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp index 99b34353c..65e1a140e 100644 --- a/src/BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp +++ b/src/BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp @@ -314,13 +314,11 @@ void btSimulationIslandManagerMt::buildIslands( btDispatcher* dispatcher, btColl btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { - if (colObj0->getActivationState()== ACTIVE_TAG) - { - allSleeping = false; - } - if (colObj0->getActivationState()== DISABLE_DEACTIVATION) + if (colObj0->getActivationState()== ACTIVE_TAG || + colObj0->getActivationState()== DISABLE_DEACTIVATION) { allSleeping = false; + break; } } }