Rover API Documentation
rover::RoverQMC5883L Class Reference

RoverQMC5883L is a class that is inherited from RoverSensor abstract class. RoverQMC5883L class contains member functions and variables to set up and read from QMC5883L bearing sensor that is embedded on the rover. More...

#include <rover_qmc5883l.hpp>

Inheritance diagram for rover::RoverQMC5883L:
rover::RoverSensor

Public Member Functions

 RoverQMC5883L ()
 Constructor for the RoverQMC5883L class. More...
 
 ~RoverQMC5883L ()
 Destructor for the RoverQMC5883L class. More...
 
void initialize (void)
 Function to setup QMC5883L sensor. More...
 
float read (void)
 Reads the bearing value from Bearing sensor QMC5883L (float). More...
 
void calibrate (void) const
 Starts calibration for the bearing sensor. More...
 
void setQMC5883LAddress (const int address)
 Sets the QMC588L Address. More...
 
void setQMC5883LCalibrationPeriod (const int period)
 Sets the QMC588L Calibration Duration. More...
 
void setQMC5883LDeclinationAngle (const float angle)
 Sets the QMC588L Declination angle. More...
 
int getQMC5883LAddress (void)
 Returns the private attribute QMC588L_ADDRESS. More...
 
int getQMC5883LCalibrationPeriod (void)
 Returns the QMC588L Calibration Duration. More...
 
float getQMC5883LDeclinationAngle (void)
 Returns the QMC588L Declination angle. More...
 
- Public Member Functions inherited from rover::RoverSensor
virtual ~RoverSensor ()
 Destructor for the RoverSensor class. More...
 

Private Member Functions

template<typename T >
MINIMUM_ (const T &a, const T &b)
 Inline macro to find minimum of two values regardles of their types (template). More...
 
template<typename T >
MAXIMUM_ (const T &a, const T &b)
 Inline macro to find maximum of two values regardles of their types (template). More...
 

Private Attributes

int QMC5883L_ADDRESS
 Address for compass sensor. More...
 
int CALIBRATION_DURATION
 Calibration duration for compass sensor. More...
 
float DECLINATION_ANGLE
 Declination angle / correction factor for compass sensor. More...
 
unsigned int calibration_start
 Calibration variable for QMC5883L. More...
 
int ROVERQMC5883L_SETUP_
 Flag to hold if RoverQMC5883L is set up. More...
 
int16_t xMinRaw
 Calibration variable to hold the minimum of xRaw results. More...
 
int16_t xMaxRaw
 Calibration variable to hold the maximum of xRaw results. More...
 
int16_t yMinRaw
 Calibration variable to hold the minimum of yRaw results. More...
 
int16_t yMaxRaw
 Calibration variable to hold the maximum of yRaw results. More...
 
int i2c_qmc588l_fd
 Private member attribute for I2C file descriptor. More...
 

Detailed Description

RoverQMC5883L is a class that is inherited from RoverSensor abstract class. RoverQMC5883L class contains member functions and variables to set up and read from QMC5883L bearing sensor that is embedded on the rover.

Constructor & Destructor Documentation

rover::RoverQMC5883L::RoverQMC5883L ( )
explicit

Constructor for the RoverQMC5883L class.

rover::RoverQMC5883L::~RoverQMC5883L ( )

Destructor for the RoverQMC5883L class.

Member Function Documentation

void rover::RoverQMC5883L::calibrate ( void  ) const

Starts calibration for the bearing sensor.

Returns
void
int rover::RoverQMC5883L::getQMC5883LAddress ( void  )

Returns the private attribute QMC588L_ADDRESS.

Returns
address Address to return
int rover::RoverQMC5883L::getQMC5883LCalibrationPeriod ( void  )

Returns the QMC588L Calibration Duration.

Returns
period Period to return
float rover::RoverQMC5883L::getQMC5883LDeclinationAngle ( void  )

Returns the QMC588L Declination angle.

Returns
angle Declination angle to return
void rover::RoverQMC5883L::initialize ( void  )
virtual

Function to setup QMC5883L sensor.

Returns
void

Implements rover::RoverSensor.

template<typename T >
T rover::RoverQMC5883L::MAXIMUM_ ( const T &  a,
const T &  b 
)
inlineprivate

Inline macro to find maximum of two values regardles of their types (template).

Parameters
aParameter 1
bParameter 2
Returns
maximum value
template<typename T >
T rover::RoverQMC5883L::MINIMUM_ ( const T &  a,
const T &  b 
)
inlineprivate

Inline macro to find minimum of two values regardles of their types (template).

Parameters
aParameter 1
bParameter 2
Returns
minimum value
float rover::RoverQMC5883L::read ( void  )
virtual

Reads the bearing value from Bearing sensor QMC5883L (float).

Returns
bearing_val in degrees (float).

Implements rover::RoverSensor.

void rover::RoverQMC5883L::setQMC5883LAddress ( const int  address)

Sets the QMC588L Address.

Parameters
addressAddress to set
Returns
void
void rover::RoverQMC5883L::setQMC5883LCalibrationPeriod ( const int  period)

Sets the QMC588L Calibration Duration.

Parameters
periodPeriod to set
Returns
void
void rover::RoverQMC5883L::setQMC5883LDeclinationAngle ( const float  angle)

Sets the QMC588L Declination angle.

Parameters
angleDeclination angle to set
Returns
void

Member Data Documentation

int rover::RoverQMC5883L::CALIBRATION_DURATION
private

Calibration duration for compass sensor.

unsigned int rover::RoverQMC5883L::calibration_start
mutableprivate

Calibration variable for QMC5883L.

float rover::RoverQMC5883L::DECLINATION_ANGLE
private

Declination angle / correction factor for compass sensor.

int rover::RoverQMC5883L::i2c_qmc588l_fd
private

Private member attribute for I2C file descriptor.

int rover::RoverQMC5883L::QMC5883L_ADDRESS
private

Address for compass sensor.

int rover::RoverQMC5883L::ROVERQMC5883L_SETUP_
private

Flag to hold if RoverQMC5883L is set up.

int16_t rover::RoverQMC5883L::xMaxRaw
private

Calibration variable to hold the maximum of xRaw results.

int16_t rover::RoverQMC5883L::xMinRaw
private

Calibration variable to hold the minimum of xRaw results.

int16_t rover::RoverQMC5883L::yMaxRaw
private

Calibration variable to hold the maximum of yRaw results.

int16_t rover::RoverQMC5883L::yMinRaw
private

Calibration variable to hold the minimum of yRaw results.


The documentation for this class was generated from the following files: