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
|
components/imageserver/mainthread.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 #ifndef MAIN_THREAD_H 00011 #define MAIN_THREAD_H 00012 00013 #include <memory> 00014 #include <gbxsickacfr/gbxiceutilacfr/subsystemthread.h> 00015 #include <orcaice/context.h> 00016 #include <hydrodll/dynamicload.h> 00017 // remote interface 00018 #include <orcaifaceimpl/imageImpl.h> 00019 // hardware interface 00020 #include <hydrointerfaces/image.h> 00021 00022 namespace imageserver { 00023 00024 // 00025 // @brief the main executing loop of this laser component. 00026 // 00027 class MainThread : public gbxsickacfr::gbxiceutilacfr::SubsystemThread 00028 { 00029 00030 public: 00031 00032 MainThread( const orcaice::Context &context ); 00033 00034 // from SubsystemThread 00035 virtual void walk(); 00036 00037 private: 00038 00039 // Tries repeatedly to instantiate the driver 00040 void initHardwareDriver(); 00041 00042 // Loops until established 00043 void initNetworkInterface(); 00044 00045 void readData(); 00046 00047 // The laser object 00048 orcaifaceimpl::ImageImplPtr imageInterface_; 00049 00050 hydrointerfaces::Image::Config config_; 00051 // an extra config to allow sensor mounted upside-down 00052 bool compensateRoll_; 00053 00054 // space for data 00055 orca::ImageDataPtr orcaImageData_; 00056 hydrointerfaces::Image::Data hydroImageData_; 00057 00058 // The library that contains the driver factory (must be declared first so it's destructed last!!!) 00059 std::auto_ptr<hydrodll::DynamicallyLoadedLibrary> driverLib_; 00060 // Generic driver for the hardware 00061 std::auto_ptr<hydrointerfaces::Image> driver_; 00062 00063 orcaice::Context context_; 00064 }; 00065 00066 } // namespace 00067 00068 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)