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/hydrohumaninput2djoystick/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 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 ORCA2_HUMANINPUT2D_JOYSTICK_H 00012 #define ORCA2_HUMANINPUT2D_JOYSTICK_H 00013 00014 #include <hydrointerfaces/humaninput2d.h> 00015 00016 namespace humaninput2djoystick 00017 { 00018 00019 class Driver : public hydrointerfaces::HumanInput2d 00020 { 00021 public: 00022 00023 Driver( const hydroutil::Context &context ); 00024 virtual ~Driver(); 00025 00026 virtual int enable(); 00027 virtual int disable(); 00028 00029 // Non-blocking read 00030 virtual int read( Command& command ); 00031 00032 private: 00033 00034 // obscure joystick stuff 00035 int jfd_; 00036 00037 hydroutil::Context context_; 00038 }; 00039 00040 // Used for dynamically loading driver 00041 class Factory : public hydrointerfaces::HumanInput2dFactory 00042 { 00043 public: 00044 hydrointerfaces::HumanInput2d *createDriver( 00045 const hydroutil::Context &context ) const 00046 { 00047 return new Driver( context ); 00048 } 00049 }; 00050 00051 } // namespace 00052 00053 // Used for dynamically loading driver 00054 extern "C" { 00055 hydrointerfaces::HumanInput2dFactory *createHumanInput2dDriverFactory(); 00056 } 00057 00058 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)