2018-11-16 12:06:08 -08:00
|
|
|
import os
|
2018-02-26 17:35:07 +01:00
|
|
|
from gym import utils
|
|
|
|
from gym.envs.robotics import fetch_env
|
|
|
|
|
|
|
|
|
2018-11-16 12:06:08 -08:00
|
|
|
# Ensure we get the path separator correct on windows
|
2021-07-29 02:26:34 +02:00
|
|
|
MODEL_XML_PATH = os.path.join("fetch", "push.xml")
|
2018-11-16 12:06:08 -08:00
|
|
|
|
|
|
|
|
2018-02-26 17:35:07 +01:00
|
|
|
class FetchPushEnv(fetch_env.FetchEnv, utils.EzPickle):
|
2021-07-29 02:26:34 +02:00
|
|
|
def __init__(self, reward_type="sparse"):
|
2018-02-26 17:35:07 +01:00
|
|
|
initial_qpos = {
|
2021-07-29 02:26:34 +02:00
|
|
|
"robot0:slide0": 0.405,
|
|
|
|
"robot0:slide1": 0.48,
|
|
|
|
"robot0:slide2": 0.0,
|
|
|
|
"object0:joint": [1.25, 0.53, 0.4, 1.0, 0.0, 0.0, 0.0],
|
2018-02-26 17:35:07 +01:00
|
|
|
}
|
|
|
|
fetch_env.FetchEnv.__init__(
|
2021-07-29 02:26:34 +02:00
|
|
|
self,
|
|
|
|
MODEL_XML_PATH,
|
|
|
|
has_object=True,
|
|
|
|
block_gripper=True,
|
|
|
|
n_substeps=20,
|
|
|
|
gripper_extra_height=0.0,
|
|
|
|
target_in_the_air=False,
|
|
|
|
target_offset=0.0,
|
|
|
|
obj_range=0.15,
|
|
|
|
target_range=0.15,
|
|
|
|
distance_threshold=0.05,
|
|
|
|
initial_qpos=initial_qpos,
|
|
|
|
reward_type=reward_type,
|
|
|
|
)
|
2021-07-27 11:49:45 -07:00
|
|
|
utils.EzPickle.__init__(self, reward_type=reward_type)
|