Depth camera (raw Z-Buffer)
===========================

.. image:: ../../../media/sensors/depth_camera.png
  :align: center
  :width: 600


**A camera capturing RGBA image**


This sensor gets raw Z-Buffer from the camera perspective.


.. cssclass:: properties morse-section

Configuration parameters for depth camera (raw z-buffer)
--------------------------------------------------------


You can set these properties in your scripts with ``<component>.properties(<property1>=..., <property2>=...)``.

- ``cam_width`` (default: ``256``)
	(no documentation available yet)
- ``cam_height`` (default: ``256``)
	(no documentation available yet)
- ``cam_focal`` (default: ``25.0``)
	(no documentation available yet)
- ``cam_near`` (default: ``1.0``)
	(no documentation available yet)
- ``cam_far`` (default: ``20.0``)
	(no documentation available yet)
- ``Vertical_Flip`` (default: ``False``)
	(no documentation available yet)
- ``retrieve_depth`` (default: ``True``)
	(no documentation available yet)
- ``retrieve_zbuffer`` (default: ``False``)
	(no documentation available yet)


.. cssclass:: fields morse-section

Data fields
-----------


This sensor exports these datafields at each simulation step:

- ``timestamp`` (float, initial value: ``0.0``)
	number of milliseconds in simulated time
- ``image`` (buffer, initial value: ``none``)
	Raw Z-Buffer captured by the camera, not converted. bgl.Buffer of float of size ``(cam_width * cam_height * sizeof(float))`` bytes.
- ``intrinsic_matrix`` (mat3<float>, initial value: ``none``)
	The intrinsic calibration matrix, stored as a 3x3 row major Matrix.

*Interface support:*

(attention, no interface support!)

.. cssclass:: services morse-section

Services for Depth camera (raw Z-Buffer)
----------------------------------------

- ``capture(n)`` (non blocking)
    Capture **n** images
    
    
  - Parameters

    - ``n``: the number of images to take. A negative number means           take image indefinitely

- ``get_configurations()`` (blocking)
    Returns the configurations of a component (parsed from the properties).
    
    
  - Return value

    a dictionary of the current component's configurations  

- ``get_local_data()`` (blocking)
    Returns the current data stored in the sensor.
    
    
  - Return value

    a dictionary of the current sensor's data 

- ``get_properties()`` (blocking)
    Returns the properties of a component.
    
    
  - Return value

    a dictionary of the current component's properties  



.. cssclass:: examples morse-section

Examples
--------


The following examples show how to use this component in a *Builder* script:

.. code-block:: python


    from morse.builder import *
    
    robot = ATRV()
    
    # creates a new instance of the sensor
    rawimage = RawImage()

    # place your component at the correct location
    rawimage.translate(<x>, <y>, <z>)
    rawimage.rotate(<rx>, <ry>, <rz>)
    
    robot.append(rawimage)
    
    # define one or several communication interface, like 'socket'
    rawimage.add_interface(<interface>)

    env = Environment('empty')
    

.. cssclass:: files morse-section

Other sources of examples
+++++++++++++++++++++++++

- `Source code <../../_modules/morse/sensors/depth_camera.html>`_
- `Unit-test <../../_modules/base/depth_camera_testing.html>`_




*(This page has been auto-generated from MORSE module morse.sensors.depth_camera.)*
