def reset(self, env):
    self.correct_obj_idx = env.correct_obj_idx
    if (self.correct_obj_idx == 0):
        self.correct_obj_abs_pos = env.sim.data.get_site_xpos('object0')
    else:
        self.correct_obj_abs_pos = env.sim.data.get_site_xpos('object1')
    self.init_grip_pos = env.sim.data.get_site_xpos('robot0:grip')
    X_Y_FRAC = np.random.uniform(0.7, 0.8)
    Z_FRAC = np.random.uniform(0.2, 0.3)
    self.waypoint = np.zeros(3)
    self.waypoint[:2] = ((self.correct_obj_abs_pos[:2] - self.init_grip_pos[:2]) * X_Y_FRAC)
    self.waypoint[2] = ((self.correct_obj_abs_pos[2] - self.init_grip_pos[2]) * Z_FRAC)
    self.waypoint += self.init_grip_pos
    self.waypoint += np.random.uniform((- 0.01), 0.01, 3)

    def cond_0(obs):
        grip_pos = env.sim.data.get_site_xpos('robot0:grip')
        return (0.01 > np.linalg.norm((grip_pos - self.waypoint), axis=(- 1)))
    self.milestone_0_cond = cond_0

    def cond_1(obs):
        grip_pos = env.sim.data.get_site_xpos('robot0:grip')
        goal = env.goal
        return (0.01 > np.linalg.norm((grip_pos - goal)))
    self.milestone_1_cond = cond_1
    self.milestone_0_complete = False
    self.milestone_1_complete = False
    self.first_time_all_complete = (- 1)
def reset(self, env):
    self.correct_obj_idx = env.correct_obj_idx
    if (self.correct_obj_idx == 0):
        self.correct_obj_abs_pos = env.sim.data.get_site_xpos('object0')
    else:
        self.correct_obj_abs_pos = env.sim.data.get_site_xpos('object1')
    self.init_grip_pos = env.sim.data.get_site_xpos('robot0:grip')
    X_Y_FRAC = np.random.uniform(0.7, 0.8)
    Z_FRAC = np.random.uniform(0.2, 0.3)
    self.waypoint = np.zeros(3)
    self.waypoint[:2] = ((self.correct_obj_abs_pos[:2] - self.init_grip_pos[:2]) * X_Y_FRAC)
    self.waypoint[2] = ((self.correct_obj_abs_pos[2] - self.init_grip_pos[2]) * Z_FRAC)
    self.waypoint += self.init_grip_pos
    self.waypoint += np.random.uniform((- 0.01), 0.01, 3)

    def cond_0(obs):
        grip_pos = env.sim.data.get_site_xpos('robot0:grip')
        return (0.01 > np.linalg.norm((grip_pos - self.waypoint), axis=(- 1)))
    self.milestone_0_cond = cond_0

    def cond_1(obs):
        grip_pos = env.sim.data.get_site_xpos('robot0:grip')
        goal = env.goal
        return (0.01 > np.linalg.norm((grip_pos - goal)))
    self.milestone_1_cond = cond_1
    self.milestone_0_complete = False
    self.milestone_1_complete = False
    self.first_time_all_complete = (- 1)