mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-19 05:20:06 +00:00
Merge pull request #1271 from erwincoumans/master
pybullet: remove 'data' from MANIFEST.in
This commit is contained in:
commit
983da08da8
@ -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
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user