Merge remote-tracking branch 'bp/master'
This commit is contained in:
@@ -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-------------
|
||||
|
||||
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user