Go to the documentation of this file.00001 
00012 #ifndef LGL_ROBOT_PURSUER_HPP
00013 #define LGL_ROBOT_PURSUER_HPP
00014 
00015 #include <lgl/VisibilityMap.hpp>
00016 #include <lgl/PursuitNavigator.hpp>
00017 #include <lgl/PursuitGraph.hpp>
00018 #include <lgl/PursuitTaskManager.hpp>
00019 #include <lgl/CellID.hpp>
00020 
00021 #include <string>
00022 
00023 namespace jafar {
00024   namespace lgl {
00025 
00026 
00027     typedef enum {  
00028             IDLE,   
00029             BUSY,   
00030             SUPPORT,  
00031             TRACKER   
00032       } ROBOT_STATE;
00033 
00037     class RobotPursuer {
00039     
00040       private :
00041 
00042         
00043         int id ;
00044 
00045         
00046         unsigned int horizon;           
00047         unsigned int viewLength;        
00048         unsigned int temporalTolerance; 
00049         unsigned int riskTermMaxValue; 
00050         double sensorsHeight;
00051 
00052         
00053         ROBOT_STATE state ;
00054 
00055         
00056         Cell_ID position ;
00057 
00058         
00059         std::string robotAccessibilityMap;
00060         std::string targetAccessibilityMap;
00061         std::string robotVisibilityMap;
00062 
00063         
00064         PursuitNavigator* navigator ;
00065 
00066         
00067         GeoData*  geodata ;
00068         VisibilityMap* visibilityMap; 
00069 
00070         
00071         PursuitGraph* pursuitGraph; 
00072 
00073         
00074         PursuitTaskManager pursuitTaskManager ;
00075 
00076         
00077         
00078 
00079 
00080       public : 
00081 
00083         RobotPursuer(   int _id,
00084                 std::string _robotAccessibilityMap,
00085                 std::string _targetAccessibilityMap,
00086                 std::string _robotVisibilityMap,
00087                 unsigned int _horizon = 20, 
00088                 unsigned int _viewLength= 20, 
00089                 unsigned int _temporalTolerance = 7, 
00090                 unsigned int _riskTermMaxValue = 7, 
00091                 double _sensorsHeight = 1,
00092                 ROBOT_STATE _state=IDLE,
00093                 Cell_ID _position=0 
00094         );
00095       
00096         RobotPursuer(   int _id,
00097                 std::string _robotAccessibilityMap,
00098                 std::string _targetAccessibilityMap,
00099                 std::string _robotVisibilityMap,
00100                 unsigned int _horizon = 20, 
00101                 unsigned int _viewLength= 20, 
00102                 unsigned int _temporalTolerance = 7, 
00103                 unsigned int _riskTermMaxValue = 7, 
00104                 double _sensorsHeight = 1,
00105                 ROBOT_STATE _state=IDLE,
00106                 int x = 0, int y = 0
00107         );
00108       
00110         ~RobotPursuer() ;
00111 
00112         
00113         void start( int xTarget, int yTarget);
00114 
00115         void run( int xTarget, int yTarget);
00116 
00118         PursuitGraph* getPG() const;
00119 
00120         std::string getRobotAccessibilityMap()  const ;
00121         std::string getTargetAccessibilityMap() const ;
00122         std::string getRobotVisibilityMap()   const ;
00123 
00124         Cell_ID getPosition()   const ;
00125         void getPosition(int &x, int &y) const;
00126       private :
00127         void startTracking( int xTarget, int yTarget);
00128 
00129     };
00130 
00131   }
00132 }
00133 
00134 #endif