Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MirageDriver Class Reference

description of MirageDriver More...

#include <MirageDriver.h>

Inheritance diagram for MirageDriver:

Detailed Description

description of MirageDriver

Definition at line 16 of file MirageDriver.h.

List of all members.

Classes

class  DepthSubscription
class  ImageSubscription
class  SensorSubscription
class  Subscription

Public Types

enum  Encoding { ENCODE_YUV, ENCODE_PNG, ENCODE_JPG }

Public Member Functions

 MirageDriver (const std::string &name)
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 updateAllOutputs ()
virtual bool isConnected ()
 Should return true if the MotionHook is successfully connected to physical hardware.
virtual void motionStopping ()
 Called when motion process is stopping.
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 plistValueChanged (const plist::PrimitiveBase &pl)

Public Attributes

plist::Primitive< boolpersist
plist::Primitive< boolhighres
 If true, will render simulated camera input at "double" resolution instead of "full".
plist::Point initLocation
plist::Point initOrientation
plist::Primitive< boolphysicsWalk
 If true (and the kinematics configuration specifies mass for the robot), Mirage will use friction and physics to model the effects of walking; if false, Mirage will use a "perfect" model based on hints from the WalkMC itself.
plist::Primitive< boolphysicsWheels
 If true (and the kinematics configuration specifies mass for the robot), then Mirage wheel use friction and physics to model robot motion; if false, Mirage will try to directly compute and move the robot.

Static Public Attributes

static const unsigned int DEFAULT_PORT = 19785
static const unsigned int DEFAULT_FPS = 25
static const char * encodingNames [] = { "YUV", "PNG", "JPG", NULL }
 must be kept in sync with tools/mirage/CommThread.h

Protected Member Functions

void openConnection ()
void sendUpdate (plist::Dictionary &msg)
void processDriverMessage (const DriverMessaging::Message &dmsg)

Protected Attributes

Thread::Lock commLock
ionetstream comm
std::string bufferedMsg
CallbackThread opener
bool opening
plist::Primitive< floatpositions [NumOutputs]
MirageDriver::SensorSubscription sensrc
MirageDriver::ImageSubscription imgsrc
MirageDriver::DepthSubscription depthsrc

Static Private Attributes

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

Member Enumeration Documentation

enum Encoding
Enumerator:
ENCODE_YUV 
ENCODE_PNG 
ENCODE_JPG 

Definition at line 21 of file MirageDriver.h.


Constructor & Destructor Documentation

MirageDriver ( const std::string &  name  )  [explicit]

Definition at line 24 of file MirageDriver.h.


Member Function Documentation

virtual std::string getClassName (  )  const [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 44 of file MirageDriver.h.

Referenced by plistValueChanged().

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

Reimplemented from DeviceDriver.

Definition at line 51 of file MirageDriver.h.

virtual MotionHook* getMotionSink (  )  [virtual]

Reimplemented from DeviceDriver.

Definition at line 46 of file MirageDriver.h.

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

Reimplemented from DeviceDriver.

Definition at line 47 of file MirageDriver.h.

bool isConnected (  )  [virtual]

Should return true if the MotionHook is successfully connected to physical hardware.

If relevant, this will only be called after motionStarting() has been called in order to initialize a connection.

This is used mainly to cancel out of the WaitForSensors if all MotionHooks return false. If you are still in the process of connecting or unsure of status, be optimistic and return true. This function will be polled at a coarse rate while blocked on sensors in case of timeouts on the part of the MotionHook render it moot.

Implements MotionHook.

Definition at line 69 of file MirageDriver.cc.

void motionStarting (  )  [virtual]

Called when motion process is starting.

Reimplemented from MotionHook.

Definition at line 46 of file MirageDriver.cc.

void motionStopping (  )  [virtual]

Called when motion process is stopping.

Reimplemented from MotionHook.

Definition at line 73 of file MirageDriver.cc.

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 82 of file MirageDriver.cc.

Referenced by updateAllOutputs().

void openConnection (  )  [protected]

Definition at line 167 of file MirageDriver.cc.

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

Implements PrimitiveListener.

Definition at line 101 of file MirageDriver.cc.

void processDriverMessage ( const DriverMessaging::Message dmsg  )  [protected, virtual]

Implements Listener.

Definition at line 407 of file MirageDriver.cc.

void sendUpdate ( plist::Dictionary msg  )  [protected]
void updateAllOutputs (  )  [virtual]

Definition at line 57 of file MirageDriver.cc.

Referenced by openConnection().


Member Data Documentation

const std::string autoRegisterDriver = DeviceDriver::getRegistry().registerType<MirageDriver>("Mirage") [static, private]

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

Definition at line 171 of file MirageDriver.h.

Referenced by getClassName().

std::string bufferedMsg [protected]

Definition at line 77 of file MirageDriver.h.

Referenced by processDriverMessage(), and sendUpdate().

Thread::Lock commLock [protected]

Definition at line 75 of file MirageDriver.h.

Referenced by openConnection(), and sendUpdate().

const unsigned int DEFAULT_FPS = 25 [static]

Definition at line 19 of file MirageDriver.h.

Referenced by Subscription< ImageStreamDriver >::Subscription().

const unsigned int DEFAULT_PORT = 19785 [static]

Definition at line 18 of file MirageDriver.h.

Referenced by Subscription< ImageStreamDriver >::Subscription().

const char * encodingNames = { "YUV", "PNG", "JPG", NULL } [static]

must be kept in sync with tools/mirage/CommThread.h

Definition at line 22 of file MirageDriver.h.

If true, will render simulated camera input at "double" resolution instead of "full".

Definition at line 67 of file MirageDriver.h.

Referenced by MirageDriver(), openConnection(), and plistValueChanged().

Definition at line 69 of file MirageDriver.h.

Referenced by MirageDriver(), and openConnection().

Definition at line 70 of file MirageDriver.h.

Referenced by MirageDriver(), and openConnection().

CallbackThread opener [protected]

Definition at line 78 of file MirageDriver.h.

Referenced by motionStarting(), motionStopping(), and plistValueChanged().

bool opening [protected]

Definition at line 79 of file MirageDriver.h.

If true (and the kinematics configuration specifies mass for the robot), Mirage will use friction and physics to model the effects of walking; if false, Mirage will use a "perfect" model based on hints from the WalkMC itself.

Definition at line 71 of file MirageDriver.h.

Referenced by MirageDriver(), openConnection(), and plistValueChanged().

If true (and the kinematics configuration specifies mass for the robot), then Mirage wheel use friction and physics to model robot motion; if false, Mirage will try to directly compute and move the robot.

Definition at line 72 of file MirageDriver.h.

Referenced by MirageDriver(), openConnection(), and plistValueChanged().

plist::Primitive<float> positions[NumOutputs] [protected]

Definition at line 80 of file MirageDriver.h.

Referenced by motionStarting(), motionUpdated(), and openConnection().


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

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:41 2016 by Doxygen 1.6.3