A smart camera allowing to retrieve objects in its field of view
This sensor emulates a hight level camera that outputs the names of the objects that are located within the field of view of the camera.
The sensor determines first which objects are to be tracked (objects marked with a Logic Property called Object, cf documentation on passive objects for more on that). If the Label property is defined, it is used as exported name. Else the Blender object name is used. If the Type property is set, it is exported as well.
Then a test is made to identify which of these objects are inside of the view frustum of the camera. Finally, a single visibility test is performed by casting a ray from the center of the camera to the center of the object. If anything other than the test object is found first by the ray, the object is considered to be occluded by something else, even if it is only the center that is being blocked. This last check is a bit costly and can be deactivated by setting the sensor property noocclusion to True.
See also Generic Camera for generic informations about Morse cameras.
You can set these properties in your scripts with <component>.properties(<property1>=..., <property2>=...).
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
(no documentation available yet)
Do not check for objects possibly hiding each others (faster but less realistic behaviour)
This sensor exports these datafields at each simulation step:
number of milliseconds in simulated time
Interface support:
Returns the current data stored in the sensor.
Return value
a dictionary of the current sensor’s data
Returns the configurations of a component (parsed from the properties).
Return value
a dictionary of the current component’s configurations
Returns the properties of a component.
Return value
a dictionary of the current component’s properties
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
semanticcamera = SemanticCamera()
# place your component at the correct location
semanticcamera.translate(<x>, <y>, <z>)
semanticcamera.rotate(<rx>, <ry>, <rz>)
robot.append(semanticcamera)
# define one or several communication interface, like 'socket'
semanticcamera.add_interface(<interface>)
env = Environment('empty')
(This page has been auto-generated from MORSE module morse.sensors.semantic_camera.)