(self, gym_env, trajectory_generator)
Initialzes the wrapped env.

    Args:
      gym_env: An instance of LocomotionGymEnv.
      trajectory_generator: A trajectory_generator that can potentially modify
        the action and observation. Typticall generators includes the PMTG and
        openloop signals. Expected to have get_action and get_observation
        interfaces.

    Raises:
      ValueError if the controller does not implement get_action and
      get_observation.
Initialzes the wrapped env.
Initialzes the wrapped env .
def __init__(self, gym_env, trajectory_generator):
    """Initialzes the wrapped env.

    Args:
      gym_env: An instance of LocomotionGymEnv.
      trajectory_generator: A trajectory_generator that can potentially modify
        the action and observation. Typticall generators includes the PMTG and
        openloop signals. Expected to have get_action and get_observation
        interfaces.

    Raises:
      ValueError if the controller does not implement get_action and
      get_observation.

    """
    self._gym_env = gym_env
    if not hasattr(trajectory_generator, 'get_action') or not hasattr(
        trajectory_generator, 'get_observation'):
      raise ValueError(
          'The controller does not have the necessary interface(s) implemented.'
      )

    self._trajectory_generator = trajectory_generator

    # The trajectory generator can subsume the action/observation space.
    if hasattr(trajectory_generator, 'observation_space'):
      self.observation_space = self._trajectory_generator.observation_space

    if hasattr(trajectory_generator, 'action_space'):
      self.action_space = self._trajectory_generator.action_space
def __init__ ( self , gym_env , trajectory_generator ) : self . _gym_env = gym_env if not hasattr ( trajectory_generator , 'get_action' ) or not hasattr ( trajectory_generator , 'get_observation' ) : raise ValueError ( 'The controller does not have the necessary interface(s) implemented.' ) self . _trajectory_generator = trajectory_generator # The trajectory generator can subsume the action/observation space. if hasattr ( trajectory_generator , 'observation_space' ) : self . observation_space = self . _trajectory_generator . observation_space if hasattr ( trajectory_generator , 'action_space' ) : self . action_space = self . _trajectory_generator . action_space