Generic Camera

Base class for cameras in MORSE

A generic camera class, which is expected to be used as a base class for real camera. Concrete instantiation are currently:

Note

The streaming of data from this sensor can be toggled off and on by pressing the SPACE key during the simulation. This will affect all the video cameras on the scene.

Toggling off the cameras can help make the simulation run faster, specially when there are several cameras. However, the lack of data on the stream may cause problems to some middlewares.

Configuration parameters for generic 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: 0.1)

    (no documentation available yet)

  • cam_far (default: 100.0)

    (no documentation available yet)

  • Vertical_Flip (default: False)

    (no documentation available yet)

  • noocclusion (bool, default: False)

    Do not check for objects possibly hiding each others (faster but less realistic behaviour)

Data fields

No data field documented (see above for possible notes).

Services for Generic Camera

  • get_local_data() (blocking)

    Returns the current data stored in the sensor.

    • Return value

      a dictionary of the current sensor’s data

Examples

The following example shows how to use this component in a Builder script:

from morse.builder import *

robot = ATRV()

# creates a new instance of the sensor
camera = Camera()

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

robot.append(%(var)s)

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

env = Environment('empty')

Other sources of examples

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

Table Of Contents

Previous topic

Battery Sensor

Next topic

Collision

This Page