Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DynamixelDriver Class Reference

#include <Dynamixel.h>

Inheritance diagram for DynamixelDriver:

List of all members.


Detailed Description

description of Dynamixel

Definition at line 14 of file Dynamixel.h.


Public Types

enum  protocol_t { BINARY, CM5 }
typedef plist::DictionaryOf
< ServoInfo >::const_iterator 
servo_iterator

Public Member Functions

 DynamixelDriver (const std::string &name)
virtual ~DynamixelDriver ()
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 motionStarting ()
 Called when motion process is starting.
virtual void motionStopping ()
 Called when motion process is stopping.
virtual void motionCheck (const float outputs[][NumOutputs])
 Called each time the motion process has polled active motion commands.
virtual void plistValueChanged (const plist::PrimitiveBase &pl)

Public Attributes

plist::NamedEnumeration
< protocol_t
protocol
plist::DictionaryOf< ServoInfoservos
plist::Primitive< std::string > commName
plist::Primitive< bool > queryServos

Static Public Attributes

static const char * protocolNames [] = { "BINARY", "CM-5", "" }

Protected Member Functions

void provideOutput (unsigned int idx)
 forwards call to DataSource::providingOutput() if the index is valid
void ignoreOutput (unsigned int idx)
 forwards call to DataSource::ignoringOutput() if the index is valid
virtual void setServo (struct SyncWritePosSpeedEntry &packet, const servo_iterator &servo, float v)
 converts the value v from radians into the specified servo's pulse width range

Protected Attributes

bool motionActive
bool sensorsActive
std::string lastSensor
unsigned int frameNumber

Static Private Attributes

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

Classes

class  ServoInfo

Member Typedef Documentation

Definition at line 76 of file Dynamixel.h.


Member Enumeration Documentation

enum protocol_t

Enumerator:
BINARY 
CM5 

Definition at line 53 of file Dynamixel.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file Dynamixel.h.

virtual ~DynamixelDriver (  )  [inline, virtual]

Definition at line 31 of file Dynamixel.h.


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 33 of file Dynamixel.h.

Referenced by plistValueChanged().

virtual MotionHook* getMotionSink (  )  [inline, virtual]

Reimplemented from DeviceDriver.

Definition at line 35 of file Dynamixel.h.

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

Reimplemented from DeviceDriver.

Definition at line 36 of file Dynamixel.h.

void motionStarting (  )  [virtual]

Called when motion process is starting.

Reimplemented from MotionHook.

Definition at line 68 of file Dynamixel.cc.

void motionStopping (  )  [virtual]

Called when motion process is stopping.

Reimplemented from MotionHook.

Definition at line 88 of file Dynamixel.cc.

void motionCheck ( const float  outputs[][NumOutputs]  )  [virtual]

Called each time the motion process has polled active motion commands.

When in realtime mode, this should be called every FrameTime*NumFrames (defined in the RobotInfo) milliseconds if running at full speed. See enteringRealtime() and leavingRealtime().

This default implementation checks to see which outputs have changed value since the last call and passes the summary on to motionUpdated(). lastOutputs will be updated with the new values after the call to motionUpdated().

If you need to process all the outputs on every frame, you only need to override this function. Your subclass doesn't need to call the MotionHook implementation unless you want to have lastOutputs updated for you.

If you only need to process the changed outputs for each frame, override motionUpdated() instead. motionUpdated() is always called for each update, even if there aren't any changes, so you can still use that if there are some outputs which need to be updated every cycle.

Reimplemented from MotionHook.

Definition at line 98 of file Dynamixel.cc.

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

Implements PrimitiveListener.

Definition at line 153 of file Dynamixel.cc.

void provideOutput ( unsigned int  idx  )  [inline, protected]

forwards call to DataSource::providingOutput() if the index is valid

Definition at line 83 of file Dynamixel.h.

Referenced by plistValueChanged().

void ignoreOutput ( unsigned int  idx  )  [inline, protected]

forwards call to DataSource::ignoringOutput() if the index is valid

Definition at line 85 of file Dynamixel.h.

Referenced by plistValueChanged().

void setServo ( struct SyncWritePosSpeedEntry packet,
const servo_iterator servo,
float  v 
) [protected, virtual]

converts the value v from radians into the specified servo's pulse width range

Definition at line 201 of file Dynamixel.cc.

Referenced by motionCheck().


Member Data Documentation

const char * protocolNames = { "BINARY", "CM-5", "" } [static]

Definition at line 52 of file Dynamixel.h.

Definition at line 57 of file Dynamixel.h.

Referenced by DynamixelDriver().

Definition at line 79 of file Dynamixel.h.

Referenced by DynamixelDriver(), and plistValueChanged().

bool motionActive [protected]

Definition at line 97 of file Dynamixel.h.

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

bool sensorsActive [protected]

Definition at line 98 of file Dynamixel.h.

Referenced by motionStopping(), and plistValueChanged().

std::string lastSensor [protected]

Definition at line 99 of file Dynamixel.h.

unsigned int frameNumber [protected]

Definition at line 100 of file Dynamixel.h.

const std::string autoRegisterDynamixelDriver = DeviceDriver::getRegistry().registerType<DynamixelDriver>("Dynamixel") [static, private]

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

Definition at line 104 of file Dynamixel.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:20 2007 by Doxygen 1.5.4