Improve PyBullet ports of Roboschool envs: fix reset (it kept adding stadium objects, causing slowdown), now reset uses saveState/restoreState and reset becomes a few orders of magnitude faster.
Use python -m pybullet_envs.examples.testEnv --env AntBulletEnv-v0 --render=1 --steps 1000 --resetbenchmark=1 Added environments: HumanoidFlagrunBulletEnv-v0, HumanoidFlagrunHarderBulletEnv-v0, StrikerBulletEnv-v0, ThrowerBulletEnv-v0, PusherBulletEnv-v0, ReacherBulletEnv-v0, CartPoleBulletEnv-v0 and register them to OpenAI Gym. Allow numpy/humanoid_running.py to use abtch or non-batch update (setJointMotorControl2/setJointMotorControlArray)
This commit is contained in:
@@ -13,20 +13,25 @@ class StadiumScene(Scene):
|
||||
zero_at_running_strip_start_line = True # if False, center of coordinates (0,0,0) will be at the middle of the stadium
|
||||
stadium_halflen = 105*0.25 # FOOBALL_FIELD_HALFLEN
|
||||
stadium_halfwidth = 50*0.25 # FOOBALL_FIELD_HALFWID
|
||||
|
||||
stadiumLoaded=0
|
||||
|
||||
def episode_restart(self):
|
||||
Scene.episode_restart(self) # contains cpp_world.clean_everything()
|
||||
# stadium_pose = cpp_household.Pose()
|
||||
# if self.zero_at_running_strip_start_line:
|
||||
# stadium_pose.set_xyz(27, 21, 0) # see RUN_STARTLINE, RUN_RAD constants
|
||||
filename = os.path.join(pybullet_data.getDataPath(),"stadium_no_collision.sdf")
|
||||
self.stadium = p.loadSDF(filename)
|
||||
planeName = os.path.join(pybullet_data.getDataPath(),"mjcf/ground_plane.xml")
|
||||
|
||||
self.ground_plane_mjcf = p.loadMJCF(planeName)
|
||||
for i in self.ground_plane_mjcf:
|
||||
p.changeVisualShape(i,-1,rgbaColor=[0,0,0,0])
|
||||
|
||||
Scene.episode_restart(self) # contains cpp_world.clean_everything()
|
||||
if (self.stadiumLoaded==0):
|
||||
self.stadiumLoaded=1
|
||||
|
||||
# stadium_pose = cpp_household.Pose()
|
||||
# if self.zero_at_running_strip_start_line:
|
||||
# stadium_pose.set_xyz(27, 21, 0) # see RUN_STARTLINE, RUN_RAD constants
|
||||
filename = os.path.join(pybullet_data.getDataPath(),"stadium_no_collision.sdf")
|
||||
self.stadium = p.loadSDF(filename)
|
||||
planeName = os.path.join(pybullet_data.getDataPath(),"mjcf/ground_plane.xml")
|
||||
|
||||
self.ground_plane_mjcf = p.loadMJCF(planeName)
|
||||
for i in self.ground_plane_mjcf:
|
||||
p.changeVisualShape(i,-1,rgbaColor=[0,0,0,0])
|
||||
|
||||
class SinglePlayerStadiumScene(StadiumScene):
|
||||
"This scene created by environment, to work in a way as if there was no concept of scene visible to user."
|
||||
multiplayer = False
|
||||
|
||||
Reference in New Issue
Block a user