(self, physics: 'mjcf.Physics',
                         random_state: np.random.RandomState)
Randomly selects a starting point and set the walker.
Randomly selects a starting point and set the walker.
Randomly selects a starting point and set the walker .
def initialize_episode(self, physics: 'mjcf.Physics',
                         random_state: np.random.RandomState):
    """Randomly selects a starting point and set the walker."""

    # Set the walker at the beginning of the clip.
    self._set_walker(physics)
    self._walker_features = utils.get_features(
        physics, self._walker, props=self._props)
    self._walker_features_prev = self._walker_features.copy()

    self._walker_joints = np.array(physics.bind(self._walker.mocap_joints).qpos)  # pytype: disable=attribute-error

    # compute initial error
    self._compute_termination_error()
    # assert error is 0 at initialization. In particular this will prevent
    # a proto/walker mismatch.
    if self._termination_error > 1e-2:
      raise ValueError(('The termination exceeds 1e-2 at initialization. '
                        'This is likely due to a proto/walker mismatch.'))

    self._update_ghost(physics)
    self._reference_observations.update(
        self.get_all_reference_observations(physics))

    # reset reward channels
    self._reset_reward_channels()
def initialize_episode ( self , physics : 'mjcf.Physics' , random_state : np . random . RandomState ) : # Set the walker at the beginning of the clip. self . _set_walker ( physics ) self . _walker_features = utils . get_features ( physics , self . _walker , props = self . _props ) self . _walker_features_prev = self . _walker_features . copy ( ) self . _walker_joints = np . array ( physics . bind ( self . _walker . mocap_joints ) . qpos ) # pytype: disable=attribute-error # compute initial error self . _compute_termination_error ( ) # assert error is 0 at initialization. In particular this will prevent # a proto/walker mismatch. if self . _termination_error > 1e-2 : raise ValueError ( ( 'The termination exceeds 1e-2 at initialization. ' 'This is likely due to a proto/walker mismatch.' ) ) self . _update_ghost ( physics ) self . _reference_observations . update ( self . get_all_reference_observations ( physics ) ) # reset reward channels self . _reset_reward_channels ( )