Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PSDs Class Reference

#include <PSDs.h>

List of all members.


Detailed Description

This class provides methods to access the infra-red sensors. The class is designed as a singleton class. This is to ensure that the initialization process is executed only once as multiple initializations will result in errors. So at any given time there is at most one instance of the class. The method PSDs::getPSDs() can be used to access that instance.
Author:
Jia L. Du


Public Member Functions

bool initialize ()
double readLeft ()
double readRight ()
double readFront ()

Static Public Member Functions

PSDs * getPSDs ()

Protected Member Functions

 PSDs ()
 ~PSDs ()
bool release ()

Private Attributes

PSDHandle leftPSDHandle
PSDHandle rightPSDHandle
PSDHandle frontPSDHandle

Static Private Attributes

PSDs psds [NUMBER_OF_ROBOTS]


Constructor & Destructor Documentation

PSDs::PSDs   [protected]
 

PSDs::~PSDs   [protected]
 


Member Function Documentation

PSDs * PSDs::getPSDs   [static]
 

This method is used to get the instance of this singleton class

Returns:
A pointer to the instance

bool PSDs::initialize  
 

Initializes the sensors for usage. Should automatically be called by the constructor. But as the EyeSim simulator is not able to execute RoBIOS library functions in class constructors, we have declared this method as public and need to call this method manually in main

Returns:
true if successful

double PSDs::readFront  
 

Returns:
The distance to the next object as read by the front infra-red sensor (in meter)

double PSDs::readLeft  
 

Returns:
The distance to the next object as read by the left infra-red sensor (in meter)

double PSDs::readRight  
 

Returns:
The distance to the next object as read by the right infra-red sensor (in meter)

bool PSDs::release   [protected]
 

Releases the sensors after usage. Is automatically called by the destructor

Returns:
true if successful


Member Data Documentation

PSDHandle PSDs::frontPSDHandle [private]
 

Used internally to access the front infra-red sensor

PSDHandle PSDs::leftPSDHandle [private]
 

Used internally to access the left infra-red sensor

PSDs PSDs::psds [static, private]
 

The single instance that exists of this class

See also:
PSD::getPSD()

PSDHandle PSDs::rightPSDHandle [private]
 

Used internally to access the right infra-red sensor


Generated on Mon Aug 26 18:34:09 2002 for Cube Clustering by doxygen1.3-rc3