ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
00001 00032 #ifndef CCI_FOOTBOT_BASE_GROUND_SENSOR_H 00033 #define CCI_FOOTBOT_BASE_GROUND_SENSOR_H 00034 00035 namespace argos { 00036 class CCI_FootBotBaseGroundSensor; 00037 } 00038 00039 #include <argos3/core/control_interface/ci_sensor.h> 00040 #include <argos3/core/utility/math/vector2.h> 00041 #include <vector> 00042 00043 namespace argos { 00044 00045 class CCI_FootBotBaseGroundSensor : virtual public CCI_Sensor { 00046 00047 public: 00048 00049 struct SReading { 00050 Real Value; 00051 CVector2 Offset; 00052 00053 SReading() : 00054 Value(0.0f) {} 00055 00056 SReading(Real f_value, 00057 const CVector2& c_offset) : 00058 Value(f_value), 00059 Offset(c_offset) {} 00060 }; 00061 00062 typedef std::vector<SReading> TReadings; 00063 00064 public: 00065 00066 CCI_FootBotBaseGroundSensor(); 00067 00068 virtual ~CCI_FootBotBaseGroundSensor() {} 00069 00070 inline const TReadings& GetReadings() const { 00071 return m_tReadings; 00072 } 00073 00074 #ifdef ARGOS_WITH_LUA 00075 virtual void CreateLuaState(lua_State* pt_lua_state); 00076 00077 virtual void ReadingsToLuaState(lua_State* pt_lua_state); 00078 #endif 00079 00080 protected: 00081 00082 TReadings m_tReadings; 00083 00084 }; 00085 00086 std::ostream& operator<<(std::ostream& c_os, 00087 const CCI_FootBotBaseGroundSensor::SReading& s_reading); 00088 00089 std::ostream& operator<<(std::ostream& c_os, 00090 const CCI_FootBotBaseGroundSensor::TReadings& t_readings); 00091 00092 } 00093 00094 #endif