Warning: include(php/utility.php): Failed to open stream: No such file or directory in /home/argos/argos3/doc/api/embedded/a00555_source.php on line 2

Warning: include(): Failed opening 'php/utility.php' for inclusion (include_path='.:/usr/lib64/php') in /home/argos/argos3/doc/api/embedded/a00555_source.php on line 2
The ARGoS Website

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 
133  const TReadingsMap& GetShortReadingsMap();
134 
146  const TReadingsMap& GetLongReadingsMap();
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 
157  TReadings m_tReadings;
158 
160  TLastReadings m_tLastReadings;
161 
163  TReadingsMap m_tReadingsMap;
164 
166  TReadingsMap m_tShortReadingsMap;
167 
169  TReadingsMap m_tLongReadingsMap;
170 
171  };
172 
173 }
174 
175 #endif
The DTO of the distance scanner, it contains the measured distance and its angle. ...
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...
TReadingsMap m_tReadingsMap
Map storing all the last received packets.
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
TReadingsMap m_tLongReadingsMap
Map storing the last received packets from the long distance sensors.
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
TLastReadings m_tLastReadings
Vector storing the last received packets.
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 basic interface for all sensors.
Definition: ci_sensor.h:34
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...
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
TReadingsMap m_tShortReadingsMap
Map storing the last received packets from the short distance sensors.