Package populus :: Module PerceptionSystem :: Class PerceptionArea
[frames] | no frames]

Class PerceptionArea

A perception area is a spherical cone used to build up a sensor's perception zone. An area can be used to filter out perceptual beacon which do not fall into the spherical cone's boundary. Moreover, a perception area keeps a buffer with the object's which are currently inside its boundary.

Instance Methods
 
__init__(self, parentSensor, name, dist, angExt, aiming=(0, 1, 0), color=(1, 0, 0, 1))
 
__str__(self)
 
getName(self)
Return the name of the percetion area.
 
getOwner(self)
Return the owner of the area's parent sensor.
 
getMask(self)
Return the perpcetion mask the area's parent sensor.
 
getDistance(self)
Return the max distance covered by the perception area.
 
getBuffer(self)
Return a dictionary of the object which are inside the area's boundary.
 
isVisual(self)
Return true if the perceptual area is a visual area, that is if the parent sensor perceives visible objects.
 
isAuditive(self)
Return true if the perceptual area is an auditive area, that is if the parent sensor perceives audible objects.
 
isDetector(self)
Return true if the perceptual area is a detector area, that is if the parent sensor perceives detectable objects.
 
filterBeacon(self, beacon)
Filter a given beacon based on the area's spherical cone boundaries.
 
performBoundaryTests(self, beacon)
Perform spherical cone boundary test on the given beacon.
 
performOcclutionTest(self, beacon)
 
toggleVis(self)
Toggle visibility of the annotation showing the perception area.
 
show(self)
Show annotations of this perception area.
 
hide(self)
Hide annotations of this perception area.
Method Details

isVisual(self)

 

Return true if the perceptual area is a visual area, that is if the parent sensor perceives visible objects. Return false otherwise.

isAuditive(self)

 

Return true if the perceptual area is an auditive area, that is if the parent sensor perceives audible objects. Return false otherwise.

isDetector(self)

 

Return true if the perceptual area is a detector area, that is if the parent sensor perceives detectable objects. Return false otherwise.

filterBeacon(self, beacon)

 

Filter a given beacon based on the area's spherical cone boundaries. If the beacon falls into the spherical cone region then a reference to its object is saved into the area's buffer.