ci_footbot_distance_scanner_sensor.h
Go to the documentation of this file.
1 
51 #ifndef CCI_FOOTBOT_DISTANCE_SCANNER_SENSOR_H
52 #define CCI_FOOTBOT_DISTANCE_SCANNER_SENSOR_H
53 
54 /* To avoid dependency problems when including */
55 namespace argos {
56  class CCI_FootBotDistanceScannerSensor;
57 }
58 
59 #include <argos3/core/control_interface/ci_sensor.h>
60 #include <argos3/core/utility/math/angles.h>
61 #include <vector>
62 
63 namespace argos {
64 
66 
67  public:
68 
73  struct SReading {
75  Real Distance; // in cm from the center of the robot (about 10cm from the border)
76 
78  Angle(0.0f),
79  Distance(0.0f) {}
80 
81  SReading(const CRadians& c_angle,
82  Real f_distance) :
83  Angle(c_angle),
84  Distance(f_distance) {
85  }
86  };
87 
88  /* These structs are for internal use only */
89  typedef std::vector<SReading> TReadings;
90  typedef std::vector<TReadings> TLastReadings;
91  typedef std::pair<CRadians,Real> TMapPair;
92  typedef std::map<CRadians,Real> TReadingsMap;
93 
98  m_tReadings(4){
99  }
100 
105 
120  const TReadingsMap& GetReadingsMap();
121 
134 
147 
148 #ifdef ARGOS_WITH_LUA
149  virtual void CreateLuaState(lua_State* pt_lua_state);
150 
151  virtual void ReadingsToLuaState(lua_State* pt_lua_state);
152 #endif
153 
154  protected:
155 
158 
161 
164 
167 
170 
171  };
172 
173 }
174 
175 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
The basic interface for all sensors.
Definition: ci_sensor.h:34
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
const TReadingsMap & GetShortReadingsMap()
Return a map of the readings of the ds, short sensor readings A map of the readings of the ds short s...
const TReadingsMap & GetLongReadingsMap()
Return a map of the readings of the ds, long sensor readings A map of the readings of the ds long sen...
TReadingsMap m_tLongReadingsMap
Map storing the last received packets from the long distance sensors.
TReadingsMap m_tReadingsMap
Map storing all the last received packets.
TLastReadings m_tLastReadings
Vector storing the last received packets.
TReadingsMap m_tShortReadingsMap
Map storing the last received packets from the short distance sensors.
const TReadingsMap & GetReadingsMap()
Return a map of the readings of the ds A map of the readings of the ds in the following format: angle...
The DTO of the distance scanner, it contains the measured distance and its angle.