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