orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
camerareplayer.h00001 // 00002 // AlexB: '#if 0'd this out till it's fixed. 00003 // 00004 // 00005 #if 0 00006 /* 00007 * Orca-Robotics Project: Components for robotics 00008 * http://orca-robotics.sf.net/ 00009 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Ben Upcroft 00010 * 00011 * This copy of Orca is licensed to you under the terms described in 00012 * the LICENSE file included in this distribution. 00013 * 00014 */ 00015 00016 #ifndef ORCA_ORCALOGFACTORY_CAMERA_REPLAYER_H 00017 #define ORCA_ORCALOGFACTORY_CAMERA_REPLAYER_H 00018 00019 #include <IceStorm/IceStorm.h> 00020 #include <orca/camera.h> 00021 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00022 #include <orcalog/replayer.h> 00023 00024 #ifdef OPENCV_FOUND 00025 #include <cv.h> 00026 #endif 00027 00028 namespace orcalogfactory 00029 { 00030 00031 class CameraReplayer : public orca::Camera, public orcalog::Replayer 00032 { 00033 public: 00034 CameraReplayer( const std::string &format, 00035 const std::string &filename, 00036 const orcaice::Context &context ); 00037 virtual ~CameraReplayer(); 00038 00039 // from Orca object 00040 00041 virtual ::orca::CameraData getData(const ::Ice::Current& ) const; 00042 00043 virtual ::orca::CameraDescription getDescription(const ::Ice::Current& ) const; 00044 00045 virtual void subscribe(const ::orca::CameraConsumerPrx&, const ::Ice::Current& = ::Ice::Current()); 00046 00047 virtual void unsubscribe(const ::orca::CameraConsumerPrx&, const ::Ice::Current& = ::Ice::Current()); 00048 00049 virtual void replayData( int index, bool isTest=false ); 00050 00051 00052 private: 00053 hydroutil::Proxy<orca::CameraData> dataPipe_; 00054 // alexm: this pipe is not necessary 00055 hydroutil::Proxy<orca::CameraDescription> descrPipe_; 00056 00057 orca::CameraData data_; 00058 orca::CameraConsumerPrx publisher_; 00059 IceStorm::TopicPrx topicPrx_; 00060 00061 virtual void initInterfaces(); 00062 virtual void initDescription(); 00063 00064 // binary file protocol specifics 00065 void loadHeaderIce(); 00066 void loadDataIce( int index ); 00067 void loadDataJpeg( int index ); 00068 00069 // special case: custom function to replace ice_readCameraData 00070 void orca_readCameraData( Ice::InputStreamPtr iceInputStreamPtr , int index); 00071 00072 // use opencv to convert to jpg 00073 #ifdef OPENCV_FOUND 00074 IplImage* cvImage_; 00075 int nChannels_; 00076 #endif 00077 00078 // this is a counter of instaces of this type, used for registered interface name 00079 static int _counter; 00080 00081 // from Replayer 00082 virtual void openLogFile(); 00083 00084 }; 00085 00086 } // namespace 00087 00088 #endif 00089 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)