Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * retriever_thread.h - FireVision Retriever Thread 00004 * 00005 * Created: Tue Jun 26 17:37:38 2007 00006 * Copyright 2006-2007 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_ 00024 #define __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_ 00025 00026 #include <core/threading/thread.h> 00027 00028 #include <aspect/configurable.h> 00029 #include <aspect/logging.h> 00030 #include <aspect/clock.h> 00031 #include <aspect/vision.h> 00032 00033 #include <string> 00034 00035 namespace fawkes { 00036 class TimeTracker; 00037 } 00038 namespace firevision { 00039 class Camera; 00040 class SharedMemoryImageBuffer; 00041 class SeqWriter; 00042 class ColorModelLookupTable; 00043 } 00044 00045 class FvRetrieverThread 00046 : public fawkes::Thread, 00047 public fawkes::ConfigurableAspect, 00048 public fawkes::LoggingAspect, 00049 public fawkes::VisionAspect, 00050 public fawkes::ClockAspect 00051 { 00052 public: 00053 FvRetrieverThread(std::string camera_string, std::string cfg_name, std::string cfg_prefix); 00054 virtual ~FvRetrieverThread(); 00055 00056 virtual void init(); 00057 virtual void finalize(); 00058 virtual void loop(); 00059 00060 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */ 00061 protected: virtual void run() { Thread::run(); } 00062 00063 private: 00064 std::string cfg_name_; 00065 std::string cfg_prefix_; 00066 std::string camera_string_; 00067 fawkes::Time *cap_time_; 00068 00069 firevision::Camera *cam; 00070 firevision::SharedMemoryImageBuffer *shm; 00071 firevision::SeqWriter *seq_writer; 00072 fawkes::TimeTracker *__tt; 00073 unsigned int __loop_count; 00074 unsigned int __ttc_capture; 00075 unsigned int __ttc_memcpy; 00076 unsigned int __ttc_dispose; 00077 bool __cam_has_timestamp_support; 00078 00079 firevision::ColorModelLookupTable *__cm; 00080 }; 00081 00082 00083 #endif