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/hydrorangerarrayplayersonarclient/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_RANGERARRAY_PLAYERSONARCLIENT_H 00012 #define HYDRO_RANGERARRAY_PLAYERSONARCLIENT_H 00013 00014 #include <hydrointerfaces/rangerarray.h> 00015 00016 // Player proxies 00017 namespace PlayerCc 00018 { 00019 class PlayerClient; 00020 class SonarProxy; 00021 } 00022 00023 namespace rangerarrayplayersonarclient { 00024 00025 /* 00026 @brief Interface to PlayerSonar drivers. Uses Player. 00027 00028 @author Mikel Astiz (based on Alex Brooks' LaserScanner2dPlayerClient) 00029 */ 00030 class Driver : public hydrointerfaces::RangerArray 00031 { 00032 public: 00033 00034 Driver( const hydroutil::Context& context ); 00035 virtual ~Driver(); 00036 00037 virtual void getDescription( hydrointerfaces::RangerArray::Description &description ); 00038 00039 virtual void read( hydrointerfaces::RangerArray::Data &data ); 00040 00041 private: 00042 00043 void init(); 00044 00045 double detectionConeAngle_; 00046 bool usePlayerTimestamp_; 00047 00048 PlayerCc::PlayerClient *robot_; 00049 PlayerCc::SonarProxy *sonar_; 00050 00051 char *host_; 00052 int port_; 00053 int device_; 00054 00055 hydroutil::Context context_; 00056 }; 00057 00058 // Used for dynamically loading driver 00059 class Factory : public hydrointerfaces::RangerArrayFactory 00060 { 00061 public: 00062 hydrointerfaces::RangerArray* 00063 createDriver( const hydroutil::Context &context ) const 00064 { 00065 return new Driver( context ); 00066 } 00067 }; 00068 00069 } // namespace 00070 00071 // Used for dynamically loading driver 00072 extern "C" { 00073 hydrointerfaces::RangerArrayFactory *createRangerArrayDriverFactory(); 00074 } 00075 00076 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)