(self,
               mjcf_element,
               height=240,
               width=320,
               update_interval=1,
               buffer_size=None,
               delay=None,
               aggregator=None,
               corruptor=None,
               depth=False,
               segmentation=False,
               scene_option=None)
Initializes this observable.

    Args:
      mjcf_element: A <camera> `mjcf.Element`.
      height: (optional) An integer, the height of the rendered image.
      width: (optional) An integer, the width of the rendered image.
      update_interval: (optional) An integer, number of simulation steps between
        successive updates to the value of this observable.
      buffer_size: (optional) The maximum size of the returned buffer.
        This option is only relevant when used in conjunction with an
        `observation.Updater`. If None, `observation.DEFAULT_BUFFER_SIZE` will
        be used.
      delay: (optional) Number of additional simulation steps that must be
        taken before an observation is returned. This option is only relevant
        when used in conjunction with an`observation.Updater`. If None,
        `observation.DEFAULT_DELAY` will be used.
      aggregator: (optional) Name of an item in `AGGREGATORS` or a callable that
        performs a reduction operation over the first dimension of the buffered
        observation before it is returned. A value of `None` means that no
        aggregation will be performed and the whole buffer will be returned.
      corruptor: (optional) A callable which takes a single observation as
        an argument, modifies it, and returns it. An example use case for this
        is to add random noise to the observation. When used in a
        `BufferedWrapper`, the corruptor is applied to the observation before
        it is added to the buffer. In particular, this means that the aggregator
        operates on corrupted observations.
      depth: (optional) A boolean. If `True`, renders a depth image (1-channel)
        instead of RGB (3-channel).
      segmentation: (optional) A boolean. If `True`, renders a segmentation mask
        (2-channel, int32) labeling the objects in the scene with their
        (mjModel ID, mjtObj enum object type) pair. Background pixels are
        set to (-1, -1).
      scene_option: An optional `wrapper.MjvOption` instance that can be used to
        render the scene with custom visualization options. If None then the
        default options will be used.

    Raises:
      ValueError: if `mjcf_element` is not a <camera> element.
      ValueError: if segmentation and depth flags are both set to True.
Initializes this observable.
Initializes this observable .
def __init__(self,
               mjcf_element,
               height=240,
               width=320,
               update_interval=1,
               buffer_size=None,
               delay=None,
               aggregator=None,
               corruptor=None,
               depth=False,
               segmentation=False,
               scene_option=None):
    """Initializes this observable.

    Args:
      mjcf_element: A <camera> `mjcf.Element`.
      height: (optional) An integer, the height of the rendered image.
      width: (optional) An integer, the width of the rendered image.
      update_interval: (optional) An integer, number of simulation steps between
        successive updates to the value of this observable.
      buffer_size: (optional) The maximum size of the returned buffer.
        This option is only relevant when used in conjunction with an
        `observation.Updater`. If None, `observation.DEFAULT_BUFFER_SIZE` will
        be used.
      delay: (optional) Number of additional simulation steps that must be
        taken before an observation is returned. This option is only relevant
        when used in conjunction with an`observation.Updater`. If None,
        `observation.DEFAULT_DELAY` will be used.
      aggregator: (optional) Name of an item in `AGGREGATORS` or a callable that
        performs a reduction operation over the first dimension of the buffered
        observation before it is returned. A value of `None` means that no
        aggregation will be performed and the whole buffer will be returned.
      corruptor: (optional) A callable which takes a single observation as
        an argument, modifies it, and returns it. An example use case for this
        is to add random noise to the observation. When used in a
        `BufferedWrapper`, the corruptor is applied to the observation before
        it is added to the buffer. In particular, this means that the aggregator
        operates on corrupted observations.
      depth: (optional) A boolean. If `True`, renders a depth image (1-channel)
        instead of RGB (3-channel).
      segmentation: (optional) A boolean. If `True`, renders a segmentation mask
        (2-channel, int32) labeling the objects in the scene with their
        (mjModel ID, mjtObj enum object type) pair. Background pixels are
        set to (-1, -1).
      scene_option: An optional `wrapper.MjvOption` instance that can be used to
        render the scene with custom visualization options. If None then the
        default options will be used.

    Raises:
      ValueError: if `mjcf_element` is not a <camera> element.
      ValueError: if segmentation and depth flags are both set to True.
    """
    _check_mjcf_element(mjcf_element)
    if mjcf_element.tag != 'camera':
      raise ValueError(
          'expected a <camera> element: got {}'.format(mjcf_element))
    self._mjcf_element = mjcf_element
    self._height = height
    self._width = width

    if segmentation and depth:
      raise ValueError(_BOTH_SEGMENTATION_AND_DEPTH_ENABLED)
    if segmentation:
      self._dtype = np.int32
      self._n_channels = 2
    elif depth:
      self._dtype = np.float32
      self._n_channels = 1
    else:
      self._dtype = np.uint8
      self._n_channels = 3
    self._depth = depth
    self._segmentation = segmentation
    self._scene_option = scene_option
    super().__init__(update_interval, buffer_size, delay, aggregator, corruptor)
def __init__ ( self , mjcf_element , height = 240 , width = 320 , update_interval = 1 , buffer_size = None , delay = None , aggregator = None , corruptor = None , depth = False , segmentation = False , scene_option = None ) : _check_mjcf_element ( mjcf_element ) if mjcf_element . tag != 'camera' : raise ValueError ( 'expected a <camera> element: got {}' . format ( mjcf_element ) ) self . _mjcf_element = mjcf_element self . _height = height self . _width = width if segmentation and depth : raise ValueError ( _BOTH_SEGMENTATION_AND_DEPTH_ENABLED ) if segmentation : self . _dtype = np . int32 self . _n_channels = 2 elif depth : self . _dtype = np . float32 self . _n_channels = 1 else : self . _dtype = np . uint8 self . _n_channels = 3 self . _depth = depth self . _segmentation = segmentation self . _scene_option = scene_option super ( ) . __init__ ( update_interval , buffer_size , delay , aggregator , corruptor )