ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/robots/foot-bot/control_interface/ci_footbot_turret_torque_sensor.h
Go to the documentation of this file.
00001 
00032 #ifndef CCI_FOOTBOT_TURRET_TORQUE_SENSOR_H
00033 #define CCI_FOOTBOT_TURRET_TORQUE_SENSOR_H
00034 
00035 namespace argos {
00036    class CCI_FootBotTurretTorqueSensor;
00037 }
00038 
00039 #include <argos3/core/control_interface/ci_sensor.h>
00040 #include <argos3/core/utility/math/vector2.h>
00041 
00042 namespace argos {
00043 
00044    class CCI_FootBotTurretTorqueSensor : virtual public CCI_Sensor {
00045 
00046    public:
00047 
00048       struct SReading {
00049          Real EngineTorque;
00050          CVector2 TractionXY;
00051 
00052          struct STractionPolar {
00053             Real Force;
00054             CRadians Angle;
00055 
00056             STractionPolar() :
00057                Force(0.0) {
00058             }
00059 
00060             STractionPolar(Real f_force,
00061                            const CRadians& c_angle) :
00062                Force(f_force),
00063                Angle(c_angle) {
00064             }
00065 
00066          } TractionPolar;
00067 
00068          SReading() :
00069             EngineTorque(0.0f) {
00070          }
00071 
00072          SReading(Real f_engine_torque,
00073                   const CVector2& c_traction_xy,
00074                   Real f_force,
00075                   const CRadians& c_angle) :
00076             EngineTorque(f_engine_torque),
00077             TractionXY(c_traction_xy),
00078             TractionPolar(f_force, c_angle) {
00079          }
00080       };
00081 
00082    public:
00083 
00084       static const CRange<Real>     RAW_FORCEXY_RANGE;
00085       static const CRange<Real>     NORMALIZED_FORCEXY_RANGE;
00086       static const CRange<Real>     RAW_POLAR_RANGE;
00087       static const CRange<Real>     NORMALIZED_POLAR_RANGE;
00088       static const CRange<Real>     RAW_FORCE_TORQUE_RANGE;
00089       static const CRange<Real>     NORMALIZED_TORQUE_RANGE;
00090       static const CRange<CRadians> ANGULAR_RANGE;
00091 
00092    public:
00093 
00094       virtual ~CCI_FootBotTurretTorqueSensor() {}
00095 
00096       inline const SReading& GetReading() const {
00097          return m_sReading;
00098       }
00099 
00100    protected:
00101 
00102       SReading m_sReading;
00103 
00104    };
00105 
00106 }
00107 
00108 #endif