Distance sensor to detect nearby objects.
This sensor can be used to determine which other objects are within a certain radius of the sensor. It performs its test based only on distance. The type of tracked objects can be specified using the Track property.
You can set these properties in your scripts with <component>.properties(<property1>=..., <property2>=...).
The distance, in meters beyond which this sensor is unable to locate other robots.
The type of tracked objects. This type is looked for as game property of scene objects. You must then add a new game property to the objects you want to be detected by the proximity sensor.
This sensor exports these datafields at each simulation step:
number of milliseconds in simulated time
A list of the tracked objects located within the given radius. The keys of the dictionary are the object names, and the values are the distances (in meters) from the sensor.
deprecated. Points to near_objects for compatibility reasons.
Interface support:
The service expects a float range (in meter), and modify the range used to detect objects around the proximity sensor.
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 service allows to modify the kind of objects detected by the proximity sensor.
Returns the current data stored in the sensor.
Return value
a dictionary of the current sensor’s data
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
proximity = Proximity()
# place your component at the correct location
proximity.translate(<x>, <y>, <z>)
proximity.rotate(<rx>, <ry>, <rz>)
robot.append(proximity)
# define one or several communication interface, like 'socket'
proximity.add_interface(<interface>)
env = Environment('empty')
(This page has been auto-generated from MORSE module morse.sensors.proximity.)