Classes | Namespaces | Defines | Typedefs | Enumerations | Functions
segwayrmp.h File Reference
#include <exception>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <boost/function.hpp>
#include <boost/thread.hpp>
#include <stdint.h>
Include dependency graph for segwayrmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  segwayrmp::FiniteConcurrentSharedQueue< T >
class  segwayrmp::SegwayRMP
class  segwayrmp::SegwayStatus
class  segwayrmp::SegwayTime

Namespaces

namespace  segwayrmp

Defines

#define DEFINE_EXCEPTION(ClassName, Prefix, Message)
#define MAX_SEGWAYSTATUS_QUEUE_SIZE   100
#define RMP_THROW(ExceptionClass)   throw ExceptionClass(__FILE__, __LINE__)
#define RMP_THROW_MSG(ExceptionClass, Message)   throw ExceptionClass(__FILE__, __LINE__, (Message) )
#define RMP_THROW_MSG_AND_ID(ExceptionClass, Message, Id)   throw ExceptionClass(__FILE__, __LINE__, (Message), (Id) )

Typedefs

typedef boost::function< void(const
std::exception &)> 
segwayrmp::ExceptionCallback
typedef boost::function
< SegwayTime(void)> 
segwayrmp::GetTimeCallback
typedef boost::function< void(const
std::string &)> 
segwayrmp::LogMsgCallback
typedef boost::function< void(SegwayStatus::Ptr)> segwayrmp::SegwayStatusCallback

Enumerations

enum  segwayrmp::ControllerGainSchedule { segwayrmp::light = 0, segwayrmp::tall = 1, segwayrmp::heavy = 2 }
enum  segwayrmp::InterfaceType {
  segwayrmp::can = 0, segwayrmp::usb = 1, segwayrmp::serial = 2, segwayrmp::ethernet = 3,
  segwayrmp::no_interface = -1
}
enum  segwayrmp::OperationalMode { segwayrmp::disabled = 0, segwayrmp::tractor = 1, segwayrmp::balanced = 2, segwayrmp::power_down = 3 }
enum  segwayrmp::SegwayRMPType {
  segwayrmp::rmp50 = 0, segwayrmp::rmp100 = 1, segwayrmp::rmp200 = 2, segwayrmp::rmp400 = 3,
  segwayrmp::rmpx440 = 4
}

Functions

 segwayrmp::DEFINE_EXCEPTION (NoHighPerformanceTimersException,"","This system does not ""appear to have a High Precision Event Timer (HPET) device.")
 segwayrmp::DEFINE_EXCEPTION (ConnectionFailedException,"Error connecting to the ""SegwayRMP: ","Unspecified")
 segwayrmp::DEFINE_EXCEPTION (ReadFailedException,"Error reading from the SegwayRMP: ","Unspecified")
 segwayrmp::DEFINE_EXCEPTION (WriteFailedException,"Error writing to the SegwayRMP: ","Unspecified")
 segwayrmp::DEFINE_EXCEPTION (MoveFailedException,"Error moving the SegwayRMP: ","Unspecified")
 segwayrmp::DEFINE_EXCEPTION (ConfigurationException,"Error configuring the SegwayRMP: ","Unspecified")

Detailed Description

Author:
William Woodall <wjwwood@gmail.com>
Version:
1.0

LICENSE

The BSD License

Copyright (c) 2012 William Woodall

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

DESCRIPTION

This provides a cross platform interface for the Segway RMP's.

This library depends on Boost: http://www.boost.org/ and possibly depends on a Serial library: https://github.com/wjwwood/serial depending on the library build configuration.

Definition in file segwayrmp.h.


Define Documentation

#define DEFINE_EXCEPTION (   ClassName,
  Prefix,
  Message 
)
Value:
class ClassName : public std::exception { \
    void operator=(const ClassName &); \
    const ClassName & operator=( ClassName ); \
    const char * what_; \
    const int id_; \
  public: \
    ClassName(const char * file, const int ln, \
              const char * msg = Message, const int id = -1) : id_(id) { \
      std::stringstream ss; \
      ss << #ClassName " occurred at line " << ln \
         << " of `" << file << "`: " << Prefix << msg; \
      what_ = ss.str().c_str(); \
    } \
    virtual const char* what () const throw () { return what_; } \
    const int error_number() { return this->id_; } \
  };

Definition at line 62 of file segwayrmp.h.

#define MAX_SEGWAYSTATUS_QUEUE_SIZE   100

Defines the number of buffered SegwayStatus structures to be held.

Definition at line 92 of file segwayrmp.h.

#define RMP_THROW (   ExceptionClass)    throw ExceptionClass(__FILE__, __LINE__)

Definition at line 80 of file segwayrmp.h.

#define RMP_THROW_MSG (   ExceptionClass,
  Message 
)    throw ExceptionClass(__FILE__, __LINE__, (Message) )

Definition at line 83 of file segwayrmp.h.

#define RMP_THROW_MSG_AND_ID (   ExceptionClass,
  Message,
  Id 
)    throw ExceptionClass(__FILE__, __LINE__, (Message), (Id) )

Definition at line 86 of file segwayrmp.h.



libsegwayrmp
Author(s): William Woodall
autogenerated on Fri Jan 3 2014 11:28:21