Depth (XYZ) camera

../../_images/depth_camera.png

A camera capturing 3D points cloud

This sensor generates a 3D point cloud from the camera perspective.

Configuration parameters for depth (xyz) camera

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)

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)

    The data captured by the camera, stored as a Python Buffer class object. The data is of size (cam_width * cam_height * 4) bytes. The image is stored as RGBA.

  • intrinsic_matrix (mat3<float>, initial value: none)

    The intrinsic calibration matrix, stored as a 3x3 row major Matrix.

  • points (memoryview, initial value: none)

    List of 3D points from the depth camera. memoryview of a set of float(x,y,z). The data is of size (nb_points * 12) bytes (12=3*sizeof(float).

  • nb_points (int, initial value: 0)

    the number of points found in the points list. It must be inferior to cam_width * cam_height

Interface support:

  • pocolibs as Spix3DImagePoster (morse.middleware.pocolibs.sensors.stereopixel.Spix3DImagePoster)
  • ros as DepthCameraPublisher (morse.middleware.ros.depth_camera.DepthCameraPublisher)
  • socket as a JSON-Encoded message for the DepthCamera (morse.middleware.sockets.depth_camera.DepthCameraPublisher)

Services for Depth (XYZ) camera

  • capture(n) (non blocking)

    Capture n images

    • Parameters
      • n: the number of images to take. A negative number means take image indefinitely
  • get_local_data() (blocking)

    Returns the current data stored in the sensor.

    • Return value

      a dictionary of the current sensor’s data

  • get_configurations() (blocking)

    Returns the configurations of a component (parsed from the properties).

    • Return value

      a dictionary of the current component’s configurations

  • get_properties() (blocking)

    Returns the properties of a component.

    • Return value

      a dictionary of the current component’s properties

Examples

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

from morse.builder import *

robot = ATRV()

# creates a new instance of the sensor
depthcamera = DepthCamera()

# place your component at the correct location
depthcamera.translate(<x>, <y>, <z>)
depthcamera.rotate(<rx>, <ry>, <rz>)

robot.append(depthcamera)

# define one or several communication interface, like 'socket'
depthcamera.add_interface(<interface>)

env = Environment('empty')

Other sources of examples

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

Table Of Contents

Previous topic

Compound Sensor

Next topic

GPS

This Page