def __init__(
            self, goals=np.zeros((10, 2)), reset_args=None,
            include_rstate = False,
            nlp_sentence=["yellow", "cylinder", "blue"],
            *args, **kwargs):
        self.objects = ["cube", "sphere", "cylinder"]
        self.object_colors = ["red", "blue", "black", "yellow"]
        self.target_colors = ["orange", "black", "purple", "blue"]
        self.rstate = init_rstate(1)
        self.reset_args = reset_args
        self.include_rstate = include_rstate

        # TODO: Fill these in automatically
        # Dict of object to index in qpos
        self.object_dict = {(0, 0): [2, 3],
                            (1, 0): [4, 5],
                            (2, 1): [6, 7],
                            (3, 2): [8, 9]}
        self.goals = goals
        # Dict of targets to index in geom_pos
        self.target_dict = {0: 8, 1: 6, 2: 7, 3: 5}
        self.reward_fn = self.make_reward(nlp_sentence)
        self.attached_object = (-1, -1)
        self.all_objects = [(-1, -1), (0, 0), (1, 0), (2, 1), (3, 2)]
        self.threshold = 0.4
        self.move_distance = 0.2
        self.viewer = None
        utils.EzPickle.__init__(self)
        gym.envs.mujoco.MujocoEnv.__init__(self, get_asset_xml('play_pen.xml'), 1)
        self.action_space = spaces.Discrete(4)
Ejemplo n.º 2
0
 def __init__(self,
              goals=np.zeros((10, 2)),
              include_rstate=False,
              *args,
              **kwargs):
     self.rstate = init_rstate(1)
     self.include_rstate = include_rstate
     self.goals = goals
     kwargs['file_path'] = get_asset_xml('wheeled.xml')
     super(WheeledEnv, self).__init__(*args, **kwargs)
     Serializable.__init__(self, *args, **kwargs)
     self.frame_skip = 3
Ejemplo n.º 3
0
 def __init__(self,
              frame_skip,
              goals,
              include_rstate,
              ctrl_cost_coeff=1e-2,
              *args,
              **kwargs):
     self.goals = goals
     self.ctrl_cost_coeff = ctrl_cost_coeff
     self.include_rstate = include_rstate
     kwargs['file_path'] = get_asset_xml('swimmer_vel.xml')
     super(SwimmerEnv, self).__init__(*args, **kwargs)
     Serializable.quick_init(self, locals())
     self.frame_skip = frame_skip
Ejemplo n.º 4
0
 def __init__(self,
              nlp_sentence=["yellow", "cylinder", "blue"],
              reset_args=None,
              goals=np.zeros((8)),
              include_rstate=False,
              border=5.6,
              *args,
              **kwargs):
     self.objects = ["cube", "sphere", "cylinder"]
     self.object_colors = ["red", "blue", "black", "yellow"]
     self.target_colors = ["orange", "black", "purple", "blue"]
     self.border = border
     self.rstate = init_rstate(1)
     if reset_args is not None:
         raise NotImplementedError
     self.reset_args = reset_args
     self.goals = goals
     self.include_rstate = include_rstate
     self.object_dict = {
         (0, 0): [2, 3],
         (1, 0): [4, 5],
         (2, 1): [6, 7],
         (3, 2): [8, 9]
     }
     # Dict of targets to index in geom_pos
     self.target_dict = {0: 8, 1: 6, 2: 7, 3: 5}
     self.attached_object = (-1, -1)
     self.all_objects = [(-1, -1), (0, 0), (1, 0), (2, 1), (3, 2)]
     self.threshold = 0.4
     self.move_distance = 0.2
     self.viewer = None
     self.reward_fn = None
     self.init_rstate = None
     utils.EzPickle.__init__(self)
     gym.envs.mujoco.MujocoEnv.__init__(self,
                                        get_asset_xml('play_pen_large.xml'),
                                        1)
     self.action_space = spaces.Discrete(6)