epuckIR.hpp
Go to the documentation of this file.
1/* Copyright 2008 Renato Florentino Garcia <fgar.renato@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15
16#ifndef EPUCK_IR_HPP
17#define EPUCK_IR_HPP
18
19#include "epuckInterface.hpp"
20#include <vector>
21
31class EpuckIR : public EpuckInterface
32{
33public:
34
36 static const unsigned SENSOR_QUANTITY = 8;
37
39 struct IRData
40 {
41 std::vector<float> voltages;
42 std::vector<float> ranges;
43 };
44
45
52 EpuckIR(const SerialPort* const serialPort);
53
60 IRData GetIRData() const;
61
66 inline std::vector<EpuckInterface::Triple> GetGeometry() const
67 {
68 return this->geometry;
69 }
70
71private:
72
73 std::vector<EpuckInterface::Triple> geometry;
74};
75
76#endif
Class for to get data from e-puck IR sensors.
Definition epuckIR.hpp:32
IRData GetIRData() const
Read the IR sensors.
Definition epuckIR.cpp:64
EpuckIR(const SerialPort *const serialPort)
The EpuckIR class constructor.
Definition epuckIR.cpp:18
static const unsigned SENSOR_QUANTITY
The number of IR sensors on e-puck.
Definition epuckIR.hpp:36
std::vector< EpuckInterface::Triple > GetGeometry() const
Give the geometry of each IR sensor in e-puck.
Definition epuckIR.hpp:66
Base class for all concrete interfaces of e-puck.
Definition epuckInterface.hpp:34
const SerialPort *const serialPort
A SerialPort class instance shared among the device interfaces.
Definition epuckInterface.hpp:59
Send and receive messages from e-puck.
Definition serialPort.hpp:41
Header file of the EpuckInterface class and the struct EpuckInterface::Triple.
Represents the data got from e-puck IR sensors.
Definition epuckIR.hpp:40
std::vector< float > ranges
The equivalent obstacle distance.
Definition epuckIR.hpp:42
std::vector< float > voltages
The raw IR readings.
Definition epuckIR.hpp:41