INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
components/laser2d/mainthread.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 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 00011 #ifndef MAIN_THREAD_H 00012 #define MAIN_THREAD_H 00013 00014 #include <memory> 00015 #include <orcaice/subsystemthread.h> 00016 #include <orcaice/context.h> 00017 #include <hydrodll/dynamicload.h> 00018 // remote interface 00019 #include <orcaifaceimpl/laserscanner2d.h> 00020 // hardware interface 00021 #include <hydrointerfaces/laserscanner2d.h> 00022 00023 namespace laser2d { 00024 00025 class MainThread : public orcaice::SubsystemThread 00026 { 00027 public: 00028 MainThread( const orcaice::Context &context ); 00029 00030 private: 00031 // from SubsystemThread 00032 virtual void initialise(); 00033 virtual void work(); 00034 virtual void finalise(); 00035 00036 void initSettings(); 00037 00038 // Tries repeatedly to instantiate the driver 00039 void initHardwareDriver(); 00040 00041 // Loops until established 00042 void initNetworkInterface(); 00043 00044 void readData(); 00045 00046 // The laser object 00047 orcaifaceimpl::LaserScanner2dImplPtr laserInterface_; 00048 00049 hydrointerfaces::LaserScanner2d::Config config_; 00050 // an extra config to allow sensor mounted upside-down 00051 bool compensateRoll_; 00052 00053 // space for data 00054 orca::LaserScanner2dDataPtr orcaLaserData_; 00055 hydrointerfaces::LaserScanner2d::Data hydroLaserData_; 00056 00057 // The library that contains the driver factory (must be declared first so it's destructed last!!!) 00058 std::auto_ptr<hydrodll::DynamicallyLoadedLibrary> driverLib_; 00059 // Generic driver for the hardware 00060 std::auto_ptr<hydrointerfaces::LaserScanner2d> driver_; 00061 00062 orcaice::Context context_; 00063 }; 00064 00065 } // namespace 00066 00067 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)