ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/robots/foot-bot/control_interface/ci_footbot_encoder_sensor.h
Go to the documentation of this file.
00001 
00016 #ifndef CCI_FOOTBOT_ENCODER_SENSOR_H
00017 #define CCI_FOOTBOT_ENCODER_SENSOR_H
00018 
00019 /* To avoid dependency problems when including */
00020 namespace argos {
00021    class CCI_FootBotEncoderSensor;
00022 }
00023 
00024 #include <argos3/core/control_interface/ci_sensor.h>
00025 
00026 namespace argos {
00027 
00028    class CCI_FootBotEncoderSensor : public CCI_Sensor {
00029 
00030    public:
00031 
00039       struct SReading {
00040          Real CoveredDistanceLeftWheel;
00041          Real CoveredDistanceRightWheel;
00042          Real WheelAxisLength;
00043          
00044          SReading() :
00045             CoveredDistanceLeftWheel(0.0f),
00046             CoveredDistanceRightWheel(0.0f),
00047             WheelAxisLength(0.0f) {}
00048          
00049          SReading(Real f_covered_distance_left_wheel,
00050                   Real f_covered_distance_right_wheel,
00051                   Real f_wheel_axis_length) :
00052             CoveredDistanceLeftWheel(f_covered_distance_left_wheel),
00053             CoveredDistanceRightWheel(f_covered_distance_right_wheel),
00054             WheelAxisLength(f_wheel_axis_length) {
00055          }
00056 
00057       };
00058 
00062       CCI_FootBotEncoderSensor() {}
00063 
00067       virtual ~CCI_FootBotEncoderSensor() {}
00068 
00073       inline const SReading& GetReading() const {
00074          return m_sReading;
00075       }
00076 
00077 #ifdef ARGOS_WITH_LUA
00078       virtual void CreateLuaState(lua_State* pt_lua_state);
00079 
00080       virtual void ReadingsToLuaState(lua_State* pt_lua_state);
00081 #endif
00082 
00083    protected:
00084 
00085       SReading m_sReading;
00086    };
00087 
00088 }
00089 
00090 #endif