Merge pull request #1271 from erwincoumans/master

pybullet: remove 'data' from MANIFEST.in
This commit is contained in:
erwincoumans 2017-08-24 22:38:24 -07:00 committed by GitHub
commit 983da08da8
6 changed files with 21 additions and 9 deletions

View File

@ -5,7 +5,6 @@ recursive-include Extras *.h
recursive-include Extras *.hpp
recursive-include src *.h
recursive-include src *.hpp
recursive-include data *.*
recursive-include examples/pybullet/gym *.*
include examples/ThirdPartyLibs/enet/unix.c
include examples/OpenGLWindow/X11OpenGLWindow.cpp

View File

@ -18,7 +18,7 @@ register(
register(
id='RacecarBulletEnv-v0',
entry_point='pybullet_envs.bullet:RacecarBulletEnv',
entry_point='pybullet_envs.bullet:RacecarGymEnv',
timestep_limit=1000,
reward_threshold=5.0,
)

View File

@ -48,13 +48,13 @@ class MinitaurBulletEnv(gym.Env):
observation_noise_stdev=0.0,
self_collision_enabled=True,
motor_velocity_limit=np.inf,
pd_control_enabled=False,
pd_control_enabled=False,#not needed to be true if accurate motor model is enabled (has its own better PD)
leg_model_enabled=True,
accurate_motor_model_enabled=False,
accurate_motor_model_enabled=True,
motor_kp=1.0,
motor_kd=0.02,
torque_control_enabled=False,
motor_overheat_protection=False,
motor_overheat_protection=True,
hard_reset=True,
on_rack=False,
render=False,

View File

@ -43,7 +43,8 @@ class RacecarGymEnv(gym.Env):
observationDim = 2 #len(self.getExtendedObservation())
#print("observationDim")
#print(observationDim)
observation_high = np.array([np.finfo(np.float32).max] * observationDim)
# observation_high = np.array([np.finfo(np.float32).max] * observationDim)
observation_high = np.ones(observationDim) * 1000 #np.inf
if (isDiscrete):
self.action_space = spaces.Discrete(9)
else:
@ -130,7 +131,19 @@ class RacecarGymEnv(gym.Env):
return np.array(self._observation), reward, done, {}
def _render(self, mode='human', close=False):
return
width=320
height=200
img_arr = self._p.getCameraImage(width,height)
w=img_arr[0]
h=img_arr[1]
rgb=img_arr[2]
dep=img_arr[3]
#print 'width = %d height = %d' % (w,h)
# reshape creates np array
np_img_arr = np.reshape(rgb, (h, w, 4))
# remove alpha channel
np_img_arr = np_img_arr[:, :, :3]
return np_img_arr
def _termination(self):
return self._envStepCounter>1000

View File

@ -12,7 +12,7 @@ from baselines import deepq
def main():
env = RacecarGymEnv(renders=False,isDiscrete=True)
env = RacecarGymEnv(renders=True,isDiscrete=True)
act = deepq.load("racecar_model.pkl")
print(act)
while True:

View File

@ -5,7 +5,7 @@ parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0,parentdir)
from pybullet_envs.bullet.racecarGymEnv import RacecarGymEnv
isDiscrete = True
isDiscrete = False
environment = RacecarGymEnv(renders=True, isDiscrete=isDiscrete)
environment.reset()