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

Compass Class Reference

#include <Compass.h>

List of all members.

Detailed Description

This class provides methods to access the compass. 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 Compass::getCompass() can be used to access that instance.
Jia L. Du

Public Member Functions

bool initialize ()
int getHeading ()

Static Public Member Functions

Compass * getCompass ()

Protected Member Functions

 Compass ()
 ~Compass ()
bool release ()

Static Private Attributes

Compass compasses [NUMBER_OF_ROBOTS]

Constructor & Destructor Documentation

Compass::Compass   [protected]

Compass::~Compass   [protected]

Member Function Documentation

Compass * Compass::getCompass   [static]

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

A pointer to the instance

int Compass::getHeading  

This method is used to get the heading of the robot in degree (between 0 and 359)

The heading of the robot in degree

bool Compass::initialize  

Initializes the compass 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

true if successful

bool Compass::release   [protected]

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

true if successful

Member Data Documentation

Compass Compass::compasses [static, private]

The single instance that exists of this class

See also:

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