orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gpsfake/driver.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 distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDRO_GPS_FAKE_H 00012 #define HYDRO_GPS_FAKE_H 00013 00014 #include <hydrointerfaces/gps.h> 00015 00016 namespace gpsfake { 00017 00018 // 00019 // Bogus laser driver, useful for testing the rest of the component. 00020 // 00021 class Driver : public hydrointerfaces::Gps 00022 { 00023 00024 public: 00025 00026 Driver( const Config &cfg, const hydroutil::Context &context ); 00027 00028 virtual void read( hydrointerfaces::Gps::Data &data ); 00029 00030 private: 00031 00032 std::vector<double> latitudes_; 00033 std::vector<double> longitudes_; 00034 unsigned int numReads_; 00035 unsigned int dataRecord_; 00036 int fixCounter_; 00037 00038 Gps::Config config_; 00039 hydroutil::Context context_; 00040 }; 00041 00042 // Used for dynamically loading driver 00043 class Factory : public hydrointerfaces::GpsFactory 00044 { 00045 public: 00046 hydrointerfaces::Gps *createDriver( 00047 const hydrointerfaces::Gps::Config &config, 00048 const hydroutil::Context &context ) const 00049 { 00050 return new Driver( config, context ); 00051 } 00052 }; 00053 00054 } // namespace 00055 00056 // Used for dynamically loading driver 00057 extern "C" { 00058 hydrointerfaces::GpsFactory *createDriverFactory(); 00059 } 00060 00061 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)