(self, env)
return
Resets the internal state of the task.
Resets the internal state of the task.
Resets the internal state of the task .
def reset(self, env):
    """Resets the internal state of the task."""
    self._env = env
    self._last_base_position = self._get_sim_base_position()
    self._episode_start_time_offset = 0.0

    if (self._ref_motions is None or self._env.hard_reset):
      self._ref_motions = self._load_ref_motions(self._ref_motion_filenames)
      self._active_motion_id = self._sample_ref_motion()

    if (self._ref_model is None or self._env.hard_reset):
      self._ref_model = self._build_ref_model()
      self._build_joint_data()

    if self._default_pose is None or self._env.hard_reset:
      self._default_pose = self._record_default_pose()

    rand_val = self._rand_uniform(0.0, 1.0)
    ref_state_init = rand_val < self._ref_state_init_prob

    self._curr_episode_warmup = False
    if not ref_state_init and self._enable_warmup():
      self._curr_episode_warmup = True

    self._reset_ref_motion()

    perturb_state = False
    if self._enable_perturb_init_state():
      rand_val = self._rand_uniform(0.0, 1.0)
      perturb_state = rand_val < self._perturb_init_state_prob

    self._sync_sim_model(perturb_state)

    return
def reset ( self , env ) : self . _env = env self . _last_base_position = self . _get_sim_base_position ( ) self . _episode_start_time_offset = 0.0 if ( self . _ref_motions is None or self . _env . hard_reset ) : self . _ref_motions = self . _load_ref_motions ( self . _ref_motion_filenames ) self . _active_motion_id = self . _sample_ref_motion ( ) if ( self . _ref_model is None or self . _env . hard_reset ) : self . _ref_model = self . _build_ref_model ( ) self . _build_joint_data ( ) if self . _default_pose is None or self . _env . hard_reset : self . _default_pose = self . _record_default_pose ( ) rand_val = self . _rand_uniform ( 0.0 , 1.0 ) ref_state_init = rand_val < self . _ref_state_init_prob self . _curr_episode_warmup = False if not ref_state_init and self . _enable_warmup ( ) : self . _curr_episode_warmup = True self . _reset_ref_motion ( ) perturb_state = False if self . _enable_perturb_init_state ( ) : rand_val = self . _rand_uniform ( 0.0 , 1.0 ) perturb_state = rand_val < self . _perturb_init_state_prob self . _sync_sim_model ( perturb_state ) return