AttentionManager.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 by Ulrich Friedrich Klank <klank@in.tum.de>
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 /************************************************************************
00020                         AttentionManager.h - Copyright klank
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 /*LOGFILE*/
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 /*LOGFILE*/
00114 
00115   private:
00116     AttentionManager& operator=(AttentionManager&){throw "Error";}
00117     SignatureDB& m_sigDB;
00118   };
00119 }
00120 #endif // ATTENTIONMANAGER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


cognitive_perception
Author(s): Ulrich F Klank
autogenerated on Thu May 23 2013 07:38:34