orca-robotics


INTRODUCTION
Overview
Download and Install
Documentation

REPOSITORY
Interfaces
Drivers
Libraries
Utilities
Software Map

DEVELOPER
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

segwayrmpfake/driver.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 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_SEGWAYRMP_FAKE_H
00012 #define HYDRO_SEGWAYRMP_FAKE_H
00013 
00014 #include <hydrointerfaces/segwayrmp.h>
00015 
00016 namespace segwayrmpfake
00017 {
00018 
00019 /*
00020     A fake driver to simplify development. Does not require any hardware.
00021  */
00022 class Driver : public hydrointerfaces::SegwayRmp
00023 {
00024 public:
00025 
00026     Driver( const hydroutil::Context& context );
00027     virtual ~Driver();
00028 
00029     // from SegwayRmp
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::SegwayRmpFactory
00044 {
00045 public:
00046     hydrointerfaces::SegwayRmp *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::SegwayRmpFactory *createDriverFactory();
00057 }
00058 
00059 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5