2021-08-25 17:16:20 +02:00
|
|
|
from gym import register
|
|
|
|
from gym.wrappers import FlattenObservation
|
|
|
|
|
|
|
|
from . import classic_control, mujoco, robotics
|
|
|
|
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS = {"DMP": [], "ProMP": []}
|
2021-08-25 17:16:20 +02:00
|
|
|
|
2021-08-25 17:31:05 +02:00
|
|
|
# Short Continuous Mountain Car
|
|
|
|
register(
|
|
|
|
id="MountainCarContinuous-v1",
|
|
|
|
entry_point="gym.envs.classic_control:Continuous_MountainCarEnv",
|
|
|
|
max_episode_steps=100,
|
|
|
|
reward_threshold=90.0,
|
|
|
|
)
|
|
|
|
|
2021-08-25 17:16:20 +02:00
|
|
|
# Open AI
|
|
|
|
# Classic Control
|
2021-08-25 17:31:05 +02:00
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='ContinuousMountainCarProMP-v1',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:31:05 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "alr_envs:MountainCarContinuous-v1",
|
|
|
|
"wrappers": [classic_control.continuous_mountain_car.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:31:05 +02:00
|
|
|
"num_dof": 1,
|
|
|
|
"num_basis": 4,
|
|
|
|
"duration": 2,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "motor",
|
|
|
|
"policy_kwargs": {
|
|
|
|
"p_gains": 1.,
|
|
|
|
"d_gains": 1.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ContinuousMountainCarProMP-v1")
|
2021-08-25 17:31:05 +02:00
|
|
|
|
2021-08-25 17:16:20 +02:00
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='ContinuousMountainCarProMP-v0',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.classic_control:MountainCarContinuous-v0",
|
|
|
|
"wrappers": [classic_control.continuous_mountain_car.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 1,
|
|
|
|
"num_basis": 4,
|
2021-08-25 17:31:05 +02:00
|
|
|
"duration": 19.98,
|
2021-08-25 17:16:20 +02:00
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "motor",
|
|
|
|
"policy_kwargs": {
|
|
|
|
"p_gains": 1.,
|
|
|
|
"d_gains": 1.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ContinuousMountainCarProMP-v0")
|
2021-08-25 17:16:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='ReacherProMP-v2',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.mujoco:Reacher-v2",
|
|
|
|
"wrappers": [mujoco.reacher_v2.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 2,
|
|
|
|
"num_basis": 6,
|
|
|
|
"duration": 1,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "motor",
|
|
|
|
"policy_kwargs": {
|
|
|
|
"p_gains": .6,
|
|
|
|
"d_gains": .075
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("ReacherProMP-v2")
|
2021-08-25 17:16:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='FetchSlideDenseProMP-v1',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.robotics:FetchSlideDense-v1",
|
|
|
|
"wrappers": [FlattenObservation, robotics.fetch.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 4,
|
|
|
|
"num_basis": 5,
|
|
|
|
"duration": 2,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "position"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideDenseProMP-v1")
|
2021-08-25 17:16:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='FetchSlideProMP-v1',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.robotics:FetchSlide-v1",
|
|
|
|
"wrappers": [FlattenObservation, robotics.fetch.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 4,
|
|
|
|
"num_basis": 5,
|
|
|
|
"duration": 2,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "position"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchSlideProMP-v1")
|
2021-08-25 17:16:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='FetchReachDenseProMP-v1',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.robotics:FetchReachDense-v1",
|
|
|
|
"wrappers": [FlattenObservation, robotics.fetch.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 4,
|
|
|
|
"num_basis": 5,
|
|
|
|
"duration": 2,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "position"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachDenseProMP-v1")
|
2021-08-25 17:16:20 +02:00
|
|
|
|
|
|
|
register(
|
2021-11-30 16:11:32 +01:00
|
|
|
id='FetchReachProMP-v1',
|
|
|
|
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
|
2021-08-25 17:16:20 +02:00
|
|
|
kwargs={
|
|
|
|
"name": "gym.envs.robotics:FetchReach-v1",
|
|
|
|
"wrappers": [FlattenObservation, robotics.fetch.MPWrapper],
|
2022-06-29 09:37:18 +02:00
|
|
|
"traj_gen_kwargs": {
|
2021-08-25 17:16:20 +02:00
|
|
|
"num_dof": 4,
|
|
|
|
"num_basis": 5,
|
|
|
|
"duration": 2,
|
|
|
|
"post_traj_time": 0,
|
|
|
|
"zero_start": True,
|
|
|
|
"policy_type": "position"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-11-30 16:11:32 +01:00
|
|
|
ALL_GYM_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append("FetchReachProMP-v1")
|