epuckInterface.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_INTERFACE_HPP
17#define EPUCK_INTERFACE_HPP
18
19#include "serialPort.hpp"
20
34{
35public:
36
38 struct Triple
39 {
40 float x;
41 float y;
42 float theta;
43 };
44
45protected:
46
53
59 const SerialPort* const serialPort;
60
62 static const float EPUCK_DIAMETER;
63
66 {
68 SET_VEL = 0x13,
69 GET_STEPS = 0x14,
70 STOP_MOTORS = 0x15,
71 GET_IR_PROX = 0x16,
73 SET_LED_POWER = 0x18
74 };
75
76 void SendRequest(Request request) const;
77};
78
79#endif
Base class for all concrete interfaces of e-puck.
Definition epuckInterface.hpp:34
Request
Request codes acceptable by e-puck.
Definition epuckInterface.hpp:66
@ GET_STEPS
Receive the steps made and reset the stepp counter.
Definition epuckInterface.hpp:69
@ SET_VEL
Send motors steps per second velocity.
Definition epuckInterface.hpp:68
@ STOP_MOTORS
Stop the motors.
Definition epuckInterface.hpp:70
@ SET_LED_POWER
Send the state of all LEDs.
Definition epuckInterface.hpp:73
@ GET_IR_PROX
Receive the IR sensors readings.
Definition epuckInterface.hpp:71
@ GET_CAMERA_IMG
Receive an image from camera.
Definition epuckInterface.hpp:72
@ CONFIG_CAMERA
Send configurations for camera initialization.
Definition epuckInterface.hpp:67
const SerialPort *const serialPort
A SerialPort class instance shared among the device interfaces.
Definition epuckInterface.hpp:59
static const float EPUCK_DIAMETER
Diameter of e-puck body [m].
Definition epuckInterface.hpp:62
EpuckInterface(const SerialPort *const serialPort)
The EpuckInterface class constructor.
Definition epuckInterface.cpp:20
Send and receive messages from e-puck.
Definition serialPort.hpp:41
Header file of SerialPort class.
Struct which represents a triple (x,y,theta).
Definition epuckInterface.hpp:39
float x
x component.
Definition epuckInterface.hpp:40
float y
y component.
Definition epuckInterface.hpp:41
float theta
theta component.
Definition epuckInterface.hpp:42