Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TeRKDriver Class Reference

#include <TeRKDriver.h>

Inheritance diagram for TeRKDriver:

List of all members.


Detailed Description

Provides access to the Telepresence Robotics Kit, which specifies an ICE (Internet Communications Engine) based protocol for robotics control.

TeRK information:http://www.terk.ri.cmu.edu/ ICE information: http://www.zeroc.com/

To use this driver, you must install ICE, and cause the HAVE_ICE compiler flag to be set. This is most easily done by the Tekkotsu Environment.conf, set the ICE_ROOT parameter to the location of the Ice libraries. This will automatically cause HAVE_ICE to be set by the Makefiles whenever ICE_ROOT is a valid filesystem path.

Definition at line 25 of file TeRKDriver.h.


Public Member Functions

 TeRKDriver (const std::string &name)
 constructor
virtual ~TeRKDriver ()
 destructor
virtual std::string getClassName () const
 Returns the name of the class (aka its type).
virtual MotionHookgetMotionSink ()
virtual void getSensorSources (std::map< std::string, DataSource * > &sources)
virtual void getImageSources (std::map< std::string, DataSource * > &sources)
virtual void motionStarting ()
 Called when motion process is starting.
virtual void motionUpdated (const std::vector< size_t > &changedIndices, const float outputs[][NumOutputs])
 Called by motionCheck(), after comparing the new output values to lastOutputs, and before lastOutputs is updated.
virtual void motionStopping ()
 Called when motion process is stopping.
virtual void plistValueChanged (const plist::PrimitiveBase &pl)
Ice::ObjectPrx getPeerProxy (Ice::Identity proxyIdentity) const
 creates a proxy for a specified service

Public Attributes

plist::Primitive< std::string > host
 hostname of the qwerk we are connecting to.

Protected Member Functions

virtual void connect ()
 connect to qwerk
QwerkBot * connectToPeer ()
 initializes a connection to host
virtual void close ()
 closes the current proxies (reuses the communicator instance though)
inline::TeRK::LEDMode calcLEDValue (unsigned int i, float x)
 allows LEDs to flicker at various frequencies to emulate having linear brightness control instead of boolean control

Protected Attributes

float ledActivation [NumLEDs]
 used to track partial LED activation (see calcLEDValue
std::string uuid
 unique identifier, should be different for every active connection
Ice::PropertiesPtr properties
 TeRKProperties instance provides Ice configuration values, default values for which are in TeRKDriver.cc.
Ice::CommunicatorPtr ic
 The core Ice object, which manages connections, proxies, adapters, etc.
ObjectPingThreadPtr ping
 tests to make sure the remote host is still alive
QwerkBot * qwerk
 storage class holds proxies for various TeRK services.
int idcount

Private Member Functions

 TeRKDriver (const TeRKDriver &)
 do not call
TeRKDriveroperator= (const TeRKDriver &)
 do not call

Static Private Attributes

static const std::string autoRegisterTeRKDriver = DeviceDriver::getRegistry().registerType<TeRKDriver>("TeRK")
 holds the class name, set via registration with the DeviceDriver registry

Classes

class  TeRKProperties
 Grafts a Ice::Properties interface on a plist::Dictionary so we can use the Tekkotsu configuration system to control ICE. More...

Constructor & Destructor Documentation

TeRKDriver ( const std::string &  name  )  [inline, explicit]

constructor

Definition at line 28 of file TeRKDriver.h.

virtual ~TeRKDriver (  )  [inline, virtual]

destructor

Definition at line 46 of file TeRKDriver.h.

TeRKDriver ( const TeRKDriver  )  [private]

do not call


Member Function Documentation

virtual std::string getClassName (  )  const [inline, virtual]

Returns the name of the class (aka its type).

Suggested implementation is to declare a static string member, set it to the result of calling the registry's registerType, and then return that member here

Implements DeviceDriver.

Definition at line 54 of file TeRKDriver.h.

virtual MotionHook* getMotionSink (  )  [inline, virtual]

Reimplemented from DeviceDriver.

Definition at line 56 of file TeRKDriver.h.

virtual void getSensorSources ( std::map< std::string, DataSource * > &  sources  )  [inline, virtual]

Reimplemented from DeviceDriver.

Definition at line 57 of file TeRKDriver.h.

virtual void getImageSources ( std::map< std::string, DataSource * > &  sources  )  [inline, virtual]

Reimplemented from DeviceDriver.

Definition at line 62 of file TeRKDriver.h.

virtual void motionStarting (  )  [inline, virtual]

Called when motion process is starting.

Reimplemented from MotionHook.

Definition at line 68 of file TeRKDriver.h.

void motionUpdated ( const std::vector< size_t > &  ,
const float  float[][NumOutputs] 
) [virtual]

Called by motionCheck(), after comparing the new output values to lastOutputs, and before lastOutputs is updated.

Override this if you only need to send commands to the hardware for values that have changed. This function is always called for each update, even though changedIndices might be empty.

Reimplemented from MotionHook.

Definition at line 38 of file TeRKDriver.cc.

virtual void motionStopping (  )  [inline, virtual]

Called when motion process is stopping.

Reimplemented from MotionHook.

Definition at line 70 of file TeRKDriver.h.

void plistValueChanged ( const plist::PrimitiveBase pl  )  [virtual]

Implements PrimitiveListener.

Definition at line 143 of file TeRKDriver.cc.

Ice::ObjectPrx getPeerProxy ( Ice::Identity  proxyIdentity  )  const

creates a proxy for a specified service

Todo:
import QwerkBot and make this protected?)

Definition at line 259 of file TeRKDriver.cc.

Referenced by connectToPeer().

void connect (  )  [protected, virtual]

connect to qwerk

Definition at line 147 of file TeRKDriver.cc.

Referenced by motionUpdated(), and plistValueChanged().

QwerkBot * connectToPeer (  )  [protected]

initializes a connection to host

Definition at line 176 of file TeRKDriver.cc.

Referenced by connect().

virtual void close (  )  [inline, protected, virtual]

closes the current proxies (reuses the communicator instance though)

Definition at line 89 of file TeRKDriver.h.

Referenced by connect(), motionUpdated(), and ~TeRKDriver().

inline ::TeRK::LEDMode calcLEDValue ( unsigned int  i,
float  x 
) [inline, protected]

allows LEDs to flicker at various frequencies to emulate having linear brightness control instead of boolean control

Definition at line 99 of file TeRKDriver.h.

Referenced by motionUpdated().

TeRKDriver& operator= ( const TeRKDriver  )  [private]

do not call


Member Data Documentation

plist::Primitive<std::string> host

hostname of the qwerk we are connecting to.

Definition at line 79 of file TeRKDriver.h.

Referenced by connect(), connectToPeer(), getPeerProxy(), TeRKDriver(), and ~TeRKDriver().

float ledActivation[NumLEDs] [protected]

used to track partial LED activation (see calcLEDValue

Definition at line 116 of file TeRKDriver.h.

Referenced by calcLEDValue(), and TeRKDriver().

std::string uuid [protected]

unique identifier, should be different for every active connection

This will be constant for the lifetime of the TeRKDriver, as we only ever have one active connection per driver instance. (If more than one instance, each will have its own uuid however!)

Definition at line 122 of file TeRKDriver.h.

Referenced by connectToPeer(), and getPeerProxy().

Ice::PropertiesPtr properties [protected]

TeRKProperties instance provides Ice configuration values, default values for which are in TeRKDriver.cc.

These aren't really user-configurable settings, but are exposed via a Tekkotsu plist entry.

Definition at line 126 of file TeRKDriver.h.

Referenced by connect(), connectToPeer(), getPeerProxy(), and TeRKDriver().

Ice::CommunicatorPtr ic [protected]

The core Ice object, which manages connections, proxies, adapters, etc.

We create one instance and reuse it over the life of the driver. (In other words, we shouldn't need to delete/reallocate it every time we switch hosts, although if that winds up being easier, we could certainly do that instead)

Definition at line 133 of file TeRKDriver.h.

Referenced by connectToPeer(), getPeerProxy(), TeRKDriver(), and ~TeRKDriver().

ObjectPingThreadPtr ping [protected]

tests to make sure the remote host is still alive

Todo:
do we do anything if the remote host goes down?

Definition at line 137 of file TeRKDriver.h.

Referenced by close(), and connectToPeer().

QwerkBot* qwerk [protected]

storage class holds proxies for various TeRK services.

Todo:
should be imported and stored directly in driver?

Definition at line 141 of file TeRKDriver.h.

Referenced by close(), connect(), getImageSources(), getSensorSources(), and motionUpdated().

int idcount [protected]

Definition at line 143 of file TeRKDriver.h.

Referenced by connectToPeer().

const std::string autoRegisterTeRKDriver = DeviceDriver::getRegistry().registerType<TeRKDriver>("TeRK") [static, private]

holds the class name, set via registration with the DeviceDriver registry

Definition at line 198 of file TeRKDriver.h.

Referenced by getClassName().


The documentation for this class was generated from the following files:

Tekkotsu Hardware Abstraction Layer 4.0
Generated Thu Nov 22 01:01:25 2007 by Doxygen 1.5.4