00001 #ifndef __DATACOLLECTOR_H__
00002 #define __DATACOLLECTOR_H__
00003
00004 #include <string>
00005 #include <map>
00006 #include "../visionModule.H"
00007 #include <Capability.H>
00008 #include <ImageSource.H>
00009 #include <pthread.h>
00010 #include <WURDEConfiguration.H>
00011 #include <RangeFinder.H>
00012 #include <PTUnit.H>
00013 #include <fstream>
00014
00015 namespace WURDEVision {
00016
00021 class DataCollector : public VisionOperator {
00022 public:
00023 DataCollector(std::string pName);
00024 ~DataCollector();
00025
00026 void initOperator();
00027 void runOperator(WURDE::WURDEImage image, WURDE::WURDEImage stereo){}
00028 void runOperator(WURDE::WURDEImage someImage);
00029 void quitOperator();
00030
00031 void fileWriterThread1();
00032 void fileWriterThread2();
00033 void fileWriterThread3();
00034 protected:
00035 WURDE::RangeFinder m_myRF;
00036 WURDE::PTUnit m_myPTU;
00037 std::ofstream m_outfile;
00038 std::string m_outfilename;
00039 pthread_t thread1, thread2, thread3;
00040 WURDE::RunState t1state,t2state,t3state;
00041 bool m_newt1image,m_newt2image,m_newt3image;
00042 WURDE::Time t1time,t2time,t3time;
00043
00044 IplImage *m_t1image,*m_t2image,*m_t3image;
00045 int next;
00046 std::string m_imageDir;
00047 std::string m_imagePrefix;
00048 };
00049
00050 extern "C" {
00051 void *runDataCollectorThread1(void *ptr);
00052 void *runDataCollectorThread2(void *ptr);
00053 void *runDataCollectorThread3(void *ptr);
00054 }
00055
00056 };
00057
00058 #endif