Merge pull request #1271 from erwincoumans/master
pybullet: remove 'data' from MANIFEST.in
This commit is contained in:
@@ -5,7 +5,6 @@ recursive-include Extras *.h
|
|||||||
recursive-include Extras *.hpp
|
recursive-include Extras *.hpp
|
||||||
recursive-include src *.h
|
recursive-include src *.h
|
||||||
recursive-include src *.hpp
|
recursive-include src *.hpp
|
||||||
recursive-include data *.*
|
|
||||||
recursive-include examples/pybullet/gym *.*
|
recursive-include examples/pybullet/gym *.*
|
||||||
include examples/ThirdPartyLibs/enet/unix.c
|
include examples/ThirdPartyLibs/enet/unix.c
|
||||||
include examples/OpenGLWindow/X11OpenGLWindow.cpp
|
include examples/OpenGLWindow/X11OpenGLWindow.cpp
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ register(
|
|||||||
|
|
||||||
register(
|
register(
|
||||||
id='RacecarBulletEnv-v0',
|
id='RacecarBulletEnv-v0',
|
||||||
entry_point='pybullet_envs.bullet:RacecarBulletEnv',
|
entry_point='pybullet_envs.bullet:RacecarGymEnv',
|
||||||
timestep_limit=1000,
|
timestep_limit=1000,
|
||||||
reward_threshold=5.0,
|
reward_threshold=5.0,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ class MinitaurBulletEnv(gym.Env):
|
|||||||
observation_noise_stdev=0.0,
|
observation_noise_stdev=0.0,
|
||||||
self_collision_enabled=True,
|
self_collision_enabled=True,
|
||||||
motor_velocity_limit=np.inf,
|
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,
|
leg_model_enabled=True,
|
||||||
accurate_motor_model_enabled=False,
|
accurate_motor_model_enabled=True,
|
||||||
motor_kp=1.0,
|
motor_kp=1.0,
|
||||||
motor_kd=0.02,
|
motor_kd=0.02,
|
||||||
torque_control_enabled=False,
|
torque_control_enabled=False,
|
||||||
motor_overheat_protection=False,
|
motor_overheat_protection=True,
|
||||||
hard_reset=True,
|
hard_reset=True,
|
||||||
on_rack=False,
|
on_rack=False,
|
||||||
render=False,
|
render=False,
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ class RacecarGymEnv(gym.Env):
|
|||||||
observationDim = 2 #len(self.getExtendedObservation())
|
observationDim = 2 #len(self.getExtendedObservation())
|
||||||
#print("observationDim")
|
#print("observationDim")
|
||||||
#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):
|
if (isDiscrete):
|
||||||
self.action_space = spaces.Discrete(9)
|
self.action_space = spaces.Discrete(9)
|
||||||
else:
|
else:
|
||||||
@@ -130,7 +131,19 @@ class RacecarGymEnv(gym.Env):
|
|||||||
return np.array(self._observation), reward, done, {}
|
return np.array(self._observation), reward, done, {}
|
||||||
|
|
||||||
def _render(self, mode='human', close=False):
|
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):
|
def _termination(self):
|
||||||
return self._envStepCounter>1000
|
return self._envStepCounter>1000
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from baselines import deepq
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
env = RacecarGymEnv(renders=False,isDiscrete=True)
|
env = RacecarGymEnv(renders=True,isDiscrete=True)
|
||||||
act = deepq.load("racecar_model.pkl")
|
act = deepq.load("racecar_model.pkl")
|
||||||
print(act)
|
print(act)
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ parentdir = os.path.dirname(os.path.dirname(currentdir))
|
|||||||
os.sys.path.insert(0,parentdir)
|
os.sys.path.insert(0,parentdir)
|
||||||
|
|
||||||
from pybullet_envs.bullet.racecarGymEnv import RacecarGymEnv
|
from pybullet_envs.bullet.racecarGymEnv import RacecarGymEnv
|
||||||
isDiscrete = True
|
isDiscrete = False
|
||||||
|
|
||||||
environment = RacecarGymEnv(renders=True, isDiscrete=isDiscrete)
|
environment = RacecarGymEnv(renders=True, isDiscrete=isDiscrete)
|
||||||
environment.reset()
|
environment.reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user