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

Class PerceptionSystem

System level centralized Perception System. This system realizes the so called low level perception (level 0 in our specs). In other words, it simulates in a convenient way the physical interaction between the environment and a general sensor. Moreover, this system is meant to be a natural interface between the AI and the collision detection system (implemented by PhysX in the current implementation). It allows objects to register as perceptibles in the world and allows an object to mount sensors on it which will gather information about the surrounding.

Instance Methods
 
__init__(self)
 
makeInvisible(self, object)
Make a given object not detectable by visual sensors.
 
makeVisible(self, object)
Make a given object detectable by visual sensors.
 
makeMute(self, object)
Make a given object not detectable by auditory sensors.
 
registerAsPerceptible(self, object)
Register the given object as a perceptible one capable of being percept through senses.
 
unregister(self, object)
Unregister an object for the PerceptionSystem.
 
isObjectPerceptible(self, object)
Tells if the given object is physically perceptible.
 
isObjectVisible(self, object)
Return true is the given object is visible, false otherwise.
 
getPerceptibleMask(self, perceptible)
Return the perception mask of a given perceptible.
 
beginMountingSensors(self, object)
Open a mounting session for the given object.
 
endMountingSensors(self)
Close a previously opened mounting session.
 
mountSensor(self, sensor)
Mounts a given sensor on its intended owner and starts information gathering of the surroundings.
 
unmountAllSensors(self, object)
Unmount all the previously mounted sensors from the given object.
 
resetSensor(self, sensor)
Reset a given sensor and make it ready for perception.
 
sendEvent(self, event, params=[])
Wrapper for the sending events function of the messenger in Event Management System we are currently using.
 
doPerception(self, dt)
Perform perception in this time step for each entry in the perception environment.
 
update(self, dt)
Update perception in the Perception System.
Class Variables
  TIME_STEP = 0.2
  NOT_PERCEPTIBLE = 1
  PERCEPTIBLE = 2
  VISIBLE = 4
  AUDIBLE = 8
  DETECTABLE = 16
  PhysMaskPerceptible = /00100000000000000000000000000000/
Method Details

registerAsPerceptible(self, object)

 
Register the given object as a perceptible one capable of being
percept through senses.

NOTE1: the details of making an object perceptible strongly depend from the
       current requirements of the Perception System. Making an object
       perceptible when we allow for vision and hearing is different from
       when we allow for vision and smelling. Moreover, how to make an
       object perceptible depends on the chosen perception technique.

NOTE2: in the current implementation we make an object perceptible by
       making it detectable by vision and proximity sense through the
       attachment of collision solids. 

unregister(self, object)

 

Unregister an object for the PerceptionSystem. The object won't be perceived anymore.

isObjectPerceptible(self, object)

 

Tells if the given object is physically perceptible. If at least one of the object's beacon is perceptible then the object is considered physically perceptible.

isObjectVisible(self, object)

 

Return true is the given object is visible, false otherwise. Notice that a visible object is also perceptible and not perceptible object is never visible.

beginMountingSensors(self, object)

 

Open a mounting session for the given object. It's forbidden to open a new session if another one has just been opened.

mountSensor(self, sensor)

 

Mounts a given sensor on its intended owner and starts information gathering of the surroundings. It's forbiden to mount a sensor if a mouting session for the owner has not been opened yet. Returns True the sensor has been mounted, False otherwise.

unmountAllSensors(self, object)

 

Unmount all the previously mounted sensors from the given object. This operation completelly disables any perception for the object.