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/hydrorobot2dfake/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 HYDRO_ROBOT2D_FAKE_H
00012 #define HYDRO_ROBOT2D_FAKE_H
00013 
00014 #include <hydrointerfaces/robot2d.h>
00015 
00016 namespace robot2dfake
00017 {
00018 
00019 /*
00020     A fake driver to simplify development. Does not require any hardware.
00021  */
00022 class Driver : public hydrointerfaces::Robot2d
00023 {
00024 public:
00025 
00026     Driver( const hydroutil::Context& context );
00027     virtual ~Driver();
00028 
00029     // from Robot2d
00030     virtual void enable();
00031     virtual bool read( Data& data );
00032     virtual void write( const Command& command );
00033     virtual void getStatus( std::string &status, bool &isWarn, bool &isFault );
00034     virtual void applyHardwareLimits( double &maxForwardSpeed, double &maxReverseSpeed, 
00035                               double &maxTurnrate, double &maxTurnrateAtMaxSpeed );
00036 private:
00037     void disable();
00038 
00039     hydroutil::Context context_;
00040 };
00041 
00042 // Used for dynamically loading driver
00043 class Factory : public hydrointerfaces::Robot2dFactory
00044 {
00045 public:
00046     hydrointerfaces::Robot2d *createDriver( const hydroutil::Context &context ) const
00047     {
00048         return new Driver( context );
00049     }
00050 };
00051 
00052 } // namespace
00053 
00054 // Used for dynamically loading driver
00055 extern "C" {
00056     hydrointerfaces::Robot2dFactory *createRobot2dDriverFactory();
00057 }
00058 
00059 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5