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/hydrolaserscanner2dfake/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 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_FAKE_H
00012 #define HYDRO_LASERSCANNER2D_FAKE_H
00013 
00014 #include <hydrointerfaces/laserscanner2d.h>
00015 
00016 namespace laserscanner2dfake {
00017 
00018 //
00019 // Bogus laser driver, useful for testing the rest of the component.
00020 //
00021 class Driver : public hydrointerfaces::LaserScanner2d
00022 {
00023 
00024 public:
00025 
00026     Driver( const Config &cfg, const hydroutil::Context &context );
00027     virtual ~Driver();
00028 
00029     // Blocks till new data is available
00030     virtual void read( hydrointerfaces::LaserScanner2d::Data &data );
00031 
00032 private:
00033 
00034     // configurable sleep interval before returning from read() [milliseconds]
00035     int sleepIntervalMs_;
00036 
00037     LaserScanner2d::Config config_;
00038     hydroutil::Context context_;
00039 };
00040 
00041 // Used for dynamically loading driver
00042 class Factory : public hydrointerfaces::LaserScanner2dFactory
00043 {
00044 public:
00045     hydrointerfaces::LaserScanner2d *createDriver( 
00046                 const hydrointerfaces::LaserScanner2d::Config &config,
00047                 const hydroutil::Context &context ) const
00048     {
00049         return new Driver( config, context );
00050     }
00051 };
00052 
00053 } // namespace
00054 
00055 // Used for dynamically loading driver
00056 extern "C" {
00057     hydrointerfaces::LaserScanner2dFactory *createLaserScanner2dDriverFactory();
00058 }
00059 
00060 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5