EpuckIR Class Reference

Class for to get data from e-puck IR sensors. More...

#include <epuckIR.hpp>

Inheritance diagram for EpuckIR:
Inheritance graph
Collaboration diagram for EpuckIR:
Collaboration graph

Detailed Description

Class for to get data from e-puck IR sensors.

Author
Renato Florentino Garcia.
Date
August 2008

Classes

struct  IRData
 Represents the data got from e-puck IR sensors. More...
 

Public Member Functions

 EpuckIR (const SerialPort *const serialPort)
 The EpuckIR class constructor. More...
 
IRData GetIRData () const
 Read the IR sensors. More...
 
std::vector< EpuckInterface::TripleGetGeometry () const
 Give the geometry of each IR sensor in e-puck. More...
 

Static Public Attributes

static const unsigned SENSOR_QUANTITY = 8
 The number of IR sensors on e-puck.
 

Private Attributes

std::vector< EpuckInterface::Triplegeometry
 

Additional Inherited Members

- Protected Types inherited from EpuckInterface
enum  Request {
  CONFIG_CAMERA = 0x02, SET_VEL = 0x13, GET_STEPS = 0x14, STOP_MOTORS = 0x15,
  GET_IR_PROX = 0x16, GET_CAMERA_IMG = 0x17, SET_LED_POWER = 0x18
}
 Request codes acceptable by e-puck. More...
 
- Protected Member Functions inherited from EpuckInterface
 EpuckInterface (const SerialPort *const serialPort)
 The EpuckInterface class constructor. More...
 
void SendRequest (Request request) const
 
- Protected Attributes inherited from EpuckInterface
const SerialPort *const serialPort
 A SerialPort class instance shared among the device interfaces. More...
 
- Static Protected Attributes inherited from EpuckInterface
static const float EPUCK_DIAMETER = 0.07
 Diameter of e-puck body [m].
 

Constructor & Destructor Documentation

◆ EpuckIR()

EpuckIR::EpuckIR ( const SerialPort *const  serialPort)

The EpuckIR class constructor.

Parameters
serialPortPointer for a SerialPort class already created and connected with an e-puck.

References EpuckInterface::Triple::theta, EpuckInterface::Triple::x, and EpuckInterface::Triple::y.

Member Function Documentation

◆ GetGeometry()

std::vector<EpuckInterface::Triple> EpuckIR::GetGeometry ( ) const
inline

Give the geometry of each IR sensor in e-puck.

Returns
A std::vector with the sensors geometry.

◆ GetIRData()

EpuckIR::IRData EpuckIR::GetIRData ( ) const

Read the IR sensors.

Read the values of IR sensor from e-puck, and translate it for distance in meters.

Returns
A IRData struct with the read values.

References EpuckInterface::GET_IR_PROX, EpuckIR::IRData::ranges, SerialPort::recvInt(), SENSOR_QUANTITY, EpuckInterface::serialPort, and EpuckIR::IRData::voltages.

Here is the call graph for this function:

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