ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/robots/foot-bot/control_interface/ci_footbot_gripper_sensor.h
Go to the documentation of this file.
00001 
00013 #ifndef CCI_FOOTBOT_GRIPPER_SENSOR_H
00014 #define CCI_FOOTBOT_GRIPPER_SENSOR_H
00015 
00016 namespace argos {
00017    class CCI_FootBotGripperSensor;
00018 }
00019 
00020 #include <argos3/core/control_interface/ci_sensor.h>
00021 #include <argos3/core/utility/math/angles.h>
00022 
00023 namespace argos {
00024 
00025    class CCI_FootBotGripperSensor: virtual public CCI_Sensor {
00026 
00027    public:
00028 
00029       enum EGripPhase {
00030          OBJECT_NOT_GRIPPED = 0,
00031          CHECK_IN_PROGRESS,
00032          OBJECT_GRIPPED
00033       };
00034 
00035       struct SReading {
00036          CRadians GripperAperture;
00037          bool ObjectInGripper;
00038 
00039          SReading() :
00040             GripperAperture(0.0),
00041             ObjectInGripper(false) {}
00042 
00043          SReading(const CRadians& GripperAperture,
00044                   bool b_object_in_gripper) :
00045             GripperAperture(GripperAperture),
00046             ObjectInGripper(b_object_in_gripper) {}
00047 
00048       };
00049 
00050    public:
00051 
00052       CCI_FootBotGripperSensor() :
00053          m_eGripPhase(OBJECT_NOT_GRIPPED) {}
00054 
00055                         virtual ~CCI_FootBotGripperSensor() {}
00056 
00057       inline const SReading& GetReading() const {
00058          return m_sReading;
00059       }
00060 
00061                         inline bool IsObjectInGripper() const {
00062          return m_sReading.ObjectInGripper;
00063       }
00064 
00065                         inline EGripPhase GetGripPhase() const {
00066          return m_eGripPhase;
00067       }
00068 
00069    protected:
00070 
00071       SReading m_sReading;
00072       EGripPhase m_eGripPhase;
00073    };
00074 
00075 }
00076 
00077 #endif