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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

hydrodrivers/hydrohumaninput2dkbdtermio/driver.h

00001 /*
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_KEYBOARD_TERMIO_H
00012 #define ORCA2_HUMANINPUT2D_KEYBOARD_TERMIO_H
00013 
00014 #include <termios.h>
00015 
00016 #include <hydrointerfaces/humaninput2d.h>
00017 
00018 namespace humaninput2dkbdtermio
00019 {
00020 
00021 class Driver : public hydrointerfaces::HumanInput2d
00022 {
00023 public:
00024 
00025     Driver( const hydroutil::Context &context );
00026     ~Driver();
00027 
00028     virtual int enable();
00029     virtual int disable();
00030 
00031     // Blocks untill new data is available
00032     virtual int read( Command& command );
00033 
00034 private:
00035 
00036     bool enableStepInputs_;
00037 
00038     // obscure keyboard stuff
00039     int kfd_;
00040     struct termios cooked_;
00041 
00042     hydroutil::Context context_;
00043 };
00044 
00045 // Used for dynamically loading driver
00046 class Factory : public hydrointerfaces::HumanInput2dFactory
00047 {
00048 public:
00049     hydrointerfaces::HumanInput2d *createDriver( 
00050                 const hydroutil::Context &context ) const
00051     {
00052         return new Driver( context );
00053     }
00054 };
00055 
00056 } // namespace
00057 
00058 // Used for dynamically loading driver
00059 extern "C" {
00060     hydrointerfaces::HumanInput2dFactory *createHumanInput2dDriverFactory();
00061 }
00062 
00063 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5