Enki  1.9
GroundSensor.h
Go to the documentation of this file.
1 /*
2  Enki - a fast 2D robot simulator
3  Copyright (C) 1999-2016 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-2008 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://home.gna.org/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_GROUND_SENSOR_H
35 #define __ENKI_GROUND_SENSOR_H
36 
37 #include <enki/PhysicalEngine.h>
38 #include <enki/Interaction.h>
39 
44 namespace Enki
45 {
47 
57  {
58  protected:
62  const Vector pos;
64  const double mFactor;
66  const double aFactor;
67 
69  const double noiseSd;
70 
72  double filter[9][9];
73 
75  double finalValue;
76 
77  public:
79 
87  GroundSensor(Robot *owner, Vector pos, double mFactor, double aFactor, double spatialSd = 0.4, double noiseSd = 0.);
89  void init(double dt, World* w);
90 
93  double getValue(void) const { return finalValue; }
94 
96  Point getAbsolutePosition(void) const { return absPos; }
97  };
98 }
99 
100 #endif // __ENKI_GROUND_SENSOR_H
A vector in a 2D space.
Definition: Geometry.h:68
const double aFactor
Additive factor to compute finalValue.
Definition: GroundSensor.h:66
double finalValue
Final sensor value.
Definition: GroundSensor.h:75
double filter[9][9]
Pre-computed coefficient to filter ground image on a 2x2 cm square, with a 0.25 cm resolution...
Definition: GroundSensor.h:72
double getValue(void) const
Reset intensity value Return the final sensor value.
Definition: GroundSensor.h:93
Enki is the namespace of the Enki simulator. All Enki functions and classes excepted the math one are...
Definition: BluetoothBase.cpp:44
Robot * owner
The physical object that owns the interaction.
Definition: Interaction.h:62
const double noiseSd
Standard deviation of Gaussian noise in the response space.
Definition: GroundSensor.h:69
The interfaces for the interactions.
GroundSensor(Robot *owner, Vector pos, double mFactor, double aFactor, double spatialSd=0.4, double noiseSd=0.)
Constructor.
Definition: GroundSensor.cpp:44
Vector absPos
Absolute position in the world, updated on init()
Definition: GroundSensor.h:60
The world is the container of all objects and robots.
Definition: PhysicalEngine.h:411
const Vector pos
Relative position on the robot.
Definition: GroundSensor.h:62
const double mFactor
Multiplicative factor to compute finalValue.
Definition: GroundSensor.h:64
void init(double dt, World *w)
Compute absolute position.
Definition: GroundSensor.cpp:75
Interacts with another object or wall only up to a certain distance.
Definition: Interaction.h:53
The core of Enki.
A robot is a PhysicalObject that has additional interactions and a controller.
Definition: PhysicalEngine.h:379
Point getAbsolutePosition(void) const
Return the absolute position of the ground sensor, updated at each time step on init() ...
Definition: GroundSensor.h:96
A ground infrared sensor.
Definition: GroundSensor.h:56