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