Enki  1.9
Thymio2.h
Go to the documentation of this file.
1 /*
2  Enki - a fast 2D robot simulator
3  Copyright (C) 1999-2006 Stephane Magnenat <stephane at magnenat dot net>
4  Copyright (C) 2004-2005 Markus Waibel <markus dot waibel at epfl dot ch>
5  Copyright (c) 2004-2005 Antoine Beyeler <abeyeler at ab-ware dot com>
6  Copyright (C) 2005-2006 Laboratory of Intelligent Systems, EPFL, Lausanne
7  Copyright (C) 2006 Laboratory of Robotics Systems, EPFL, Lausanne
8  See AUTHORS for details
9 
10  This program is free software; the authors of any publication
11  arising from research using this software are asked to add the
12  following reference:
13  Enki - a fast 2D robot simulator
14  http://lis.epfl.ch/enki
15  Stephane Magnenat <stephane at magnenat dot net>,
16  Markus Waibel <markus dot waibel at epfl dot ch>
17  Laboratory of Intelligent Systems, EPFL, Lausanne.
18 
19  You can redistribute this program and/or modify
20  it under the terms of the GNU General Public License as published by
21  the Free Software Foundation; either version 2 of the License, or
22  (at your option) any later version.
23 
24  This program is distributed in the hope that it will be useful,
25  but WITHOUT ANY WARRANTY; without even the implied warranty of
26  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  GNU General Public License for more details.
28 
29  You should have received a copy of the GNU General Public License
30  along with this program; if not, write to the Free Software
31  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 */
33 
34 #ifndef __ENKI_THYMIO2_H
35 #define __ENKI_THYMIO2_H
36 
40 
45 namespace Enki
46 {
48 
50  {
51  public:
66 
71 
72  unsigned int textureID;
73  unsigned int* ledTexture;
74  bool ledTextureNeedUpdate;
75 
76  enum LedIndex
77  {
78  TOP = 0,
79  BOTTOM_LEFT, BOTTOM_RIGHT,
80 
81  BUTTON_UP, BUTTON_DOWN, BUTTON_LEFT, BUTTON_RIGHT,
82 
83  RING_0, RING_1, RING_2, RING_3,
84  RING_4, RING_5, RING_6, RING_7,
85 
86  IR_FRONT_0, IR_FRONT_1, IR_FRONT_2,
87  IR_FRONT_3, IR_FRONT_4, IR_FRONT_5,
88 
89  IR_BACK_0, IR_BACK_1,
90 
91  LEFT_RED, LEFT_BLUE, RIGHT_BLUE, RIGHT_RED,
92 
93  LED_COUNT
94  };
95 
96  public:
98  Thymio2();
100  ~Thymio2();
101 
102  void setLedIntensity(LedIndex ledIndex, double intensity = 1.f);
103  void setLedColor(LedIndex ledIndex, const Color& color = Color(1.,1.,1.,1.));
104  Color getColorLed(LedIndex ledIndex) const;
105 
106  protected:
107  Color ledColor[LED_COUNT];
108  };
109 }
110 
111 #endif
112 
IRSensor infraredSensor2
The infrared sensor 2 (front-front)
Definition: Thymio2.h:57
Definition: DifferentialWheeled.h:45
A simple model of the Thymio robot.
Definition: Thymio2.h:49
IRSensor infraredSensor3
The infrared sensor 3 (front-right)
Definition: Thymio2.h:59
GroundSensor groundSensor1
The ground sensor 1 (right)
Definition: Thymio2.h:70
Enki is the namespace of the Enki simulator. All Enki functions and classes excepted the math one are...
Definition: BluetoothBase.cpp:44
Header of the generic infrared sensor.
IRSensor infraredSensor4
The infrared sensor 4 (front-right-right)
Definition: Thymio2.h:61
IRSensor infraredSensor5
The infrared sensor 5 (back-left)
Definition: Thymio2.h:63
Header of the features of differential wheeled robots.
~Thymio2()
Destructor.
Definition: Thymio2.cpp:123
A generic infrared sensor.
Definition: IRSensor.h:86
IRSensor infraredSensor1
The infrared sensor 1 (front-left)
Definition: Thymio2.h:55
A color in RGBA.
Definition: Types.h:55
IRSensor infraredSensor6
The infrared sensor 6 (back-right)
Definition: Thymio2.h:65
GroundSensor groundSensor0
The ground sensor 0 (left)
Definition: Thymio2.h:68
Color color
The overall color of this object, if hull is empty or if it does not contain any texture.
Definition: PhysicalEngine.h:285
Header of the ground infrared sensor.
Thymio2()
Create a Thymio II.
Definition: Thymio2.cpp:47
IRSensor infraredSensor0
The infrared sensor 0 (front-left-left)
Definition: Thymio2.h:53
A ground infrared sensor.
Definition: GroundSensor.h:56