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
|
hydrodrivers/hydrolaserscanner2dsickcarmen/driver.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 distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDRO_LASERSCANNER2D_SICK_CARMEN_H 00012 #define HYDRO_LASERSCANNER2D_SICK_CARMEN_H 00013 00014 #include <hydrointerfaces/laserscanner2d.h> 00015 00016 // forward declaration of Carmen class 00017 class sick_laser_t; 00018 00019 namespace laserscanner2dsickcarmen { 00020 00021 // 00022 // @author Alex Brooks 00023 // 00024 class Driver : public hydrointerfaces::LaserScanner2d 00025 { 00026 00027 public: 00028 00029 Driver( const Config & cfg, 00030 const hydroutil::Context & context ); 00031 virtual ~Driver(); 00032 00033 // Blocks till new data is available 00034 virtual void read( hydrointerfaces::LaserScanner2d::Data &data ); 00035 00036 private: 00037 00038 void init(); 00039 00040 int setupParams( double maxRange, int numberOfSamples, int baudrate ); 00041 00042 Config config_; 00043 00044 // carmen core object 00045 sick_laser_t *laser_; 00046 00047 char *device_; 00048 // LMS or PMS 00049 char *type_; 00050 int baudrate_; 00051 00052 hydroutil::Context context_; 00053 00054 char sickInfoMessage_[2000]; 00055 00056 bool firstRead_; 00057 double lastStatsUpdateTime_; 00058 bool laserStalled_; 00059 }; 00060 00061 // Used for dynamically loading driver 00062 class Factory : public hydrointerfaces::LaserScanner2dFactory 00063 { 00064 public: 00065 hydrointerfaces::LaserScanner2d* 00066 createDriver( const hydrointerfaces::LaserScanner2d::Config &config, 00067 const hydroutil::Context &context ) const 00068 { 00069 return new Driver( config, context ); 00070 } 00071 }; 00072 00073 } // namespace 00074 00075 // Used for dynamically loading driver 00076 extern "C" { 00077 hydrointerfaces::LaserScanner2dFactory *createLaserScanner2dDriverFactory(); 00078 } 00079 00080 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)