fixed hole width for HoleReacher-v1

This commit is contained in:
ottofabian 2021-06-24 11:39:59 +02:00
parent 4c334b1129
commit ed75d565e2
2 changed files with 19 additions and 3 deletions

View File

@ -2,8 +2,6 @@ from gym.envs.registration import register
from alr_envs.stochastic_search.functions.f_rosenbrock import Rosenbrock from alr_envs.stochastic_search.functions.f_rosenbrock import Rosenbrock
# from alr_envs.utils.mps.dmp_wrapper import DmpWrapper
# Mujoco # Mujoco
register( register(
@ -191,7 +189,7 @@ register(
"random_start": False, "random_start": False,
"allow_self_collision": False, "allow_self_collision": False,
"allow_wall_collision": False, "allow_wall_collision": False,
"hole_width": None, "hole_width": 0.25,
"hole_depth": 1, "hole_depth": 1,
"hole_x": None, "hole_x": None,
"collision_penalty": 100, "collision_penalty": 100,

View File

@ -86,3 +86,21 @@ class ALRReacherEnv(MujocoEnv, utils.EzPickle):
# self.get_body_com("target"), # only return target to make problem harder # self.get_body_com("target"), # only return target to make problem harder
[self._steps], [self._steps],
]) ])
if __name__ == '__main__':
nl = 5
render_mode = "human" # "human" or "partial" or "final"
env = ALRReacherEnv(n_links=nl)
obs = env.reset()
for i in range(2000):
# objective.load_result("/tmp/cma")
# test with random actions
ac = env.action_space.sample()
obs, rew, d, info = env.step(ac)
if i % 10 == 0:
env.render(mode=render_mode)
if d:
env.reset()
env.close()