Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ATTENTIONMANAGER_H
00027 #define ATTENTIONMANAGER_H
00028
00029 #include <string>
00030 #include <vector>
00031 #include "XMLTag.h"
00032 #include "LogFile.h"
00033 #include "Signature.h"
00034 #include "AlgorithmSelector.h"
00035 #include "RelPose.h"
00036 #include "Comm.h"
00037 #include "PerceptionPrimitive.h"
00038
00039 #ifdef BOOST_THREAD
00040 #include "boost/thread.hpp"
00041 #else
00042 #endif
00043 #define XML_NODE_ATTENTIONMANAGER "AttentionManager"
00044
00045
00046 namespace cop
00047 {
00048 class VisFinder;
00049 class SignatureDB;
00050 class ImageInputSystem;
00051
00052 class AttendedObjects
00053 {
00054 public:
00055 AttendedObjects(PerceptionPrimitive* proto_in, PossibleLocations_t* poses_in, Comm* comm_in) : proto(proto_in), poses(poses_in), comm(comm_in) {}
00056 PerceptionPrimitive* proto;
00057 PossibleLocations_t* poses;
00058 Comm* comm;
00059 };
00070 class AttentionManager
00071 {
00072 public:
00076 AttentionManager ( XMLTag* config , SignatureDB& sig_db, ImageInputSystem& imginsys
00077 #ifdef LOGFILE
00078 , LogFile& log
00079 #endif
00080 );
00081
00085 virtual ~AttentionManager ( );
00086
00087 XMLTag* Save();
00093 void SetAttentionLevel (double attentionLevel, VisFinder* visfinder);
00094 void SetObjectToAttend (PerceptionPrimitive* prototype, PossibleLocations_t* pointOfInterest, Comm* comm);
00095 void StopAttend (Comm* comm);
00096
00097 void PerformAttentionAlg( std::vector<Sensor*> &sensors, RelPose* pose, Signature* sig, AttendedObjects& objProto);
00098 const AlgorithmSelector< std::vector<Signature*> > GetAttentionAlgorithmSelection(){return m_attendants;}
00099
00100 void threadfunc();
00101 #ifdef BOOST_THREAD
00102 boost::thread* m_learningThread;
00103 #endif
00104 bool m_Attending;
00105 ImageInputSystem& m_imginsys;
00106 private:
00107 AlgorithmSelector< std::vector<Signature*> > m_attendants;
00108 std::vector<AttendedObjects> m_attendedObjectPrototypes;
00109
00110
00111 #ifdef LOGFILE
00112 LogFile& m_logFile;
00113 #endif
00114
00115 private:
00116 AttentionManager& operator=(AttentionManager&){throw "Error";}
00117 SignatureDB& m_sigDB;
00118 };
00119 }
00120 #endif // ATTENTIONMANAGER_H