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.

Author:
  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 | aCompass

## 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 Returns: 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) Returns: 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 Returns: true if successful

bool Compass::release | ( |  | ) | `[protected]`

| Releases the compass after usage. Is automatically called by the destructor Returns: true if successful

## Member Data Documentation

Compass Compass::aCompass`[static, private]`

| The single instance that exists of this class See also: Compass::getCompass()