Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

CommThread Class Reference

#include <Dynamixel.h>

Inheritance diagram for CommThread:

Detailed Description

Definition at line 270 of file Dynamixel.h.

List of all members.

Public Member Functions

 CommThread (plist::DictionaryOf< ServoInfo > &servoList, const plist::Primitive< std::string > &comm, DynamixelDriver &parent)
 ~CommThread ()
virtual void plistCollectionEntryAdded (Collection &, ObjectBase &primitive)
virtual void plistCollectionEntryRemoved (Collection &, ObjectBase &primitive)
virtual void plistCollectionEntriesChanged (Collection &)
virtual void start ()
virtual void startOneUpdate ()
virtual Threadstop ()
virtual void waitForUpdate ()
virtual bool isStarted () const
bool takeUpdate ()
floatgetWriteBuffer ()
 find the oldest of the output buffers that isn't currently in use
void setWriteBufferTimestamp (float *buf)
 sets the timestamp on the indicated buffer (indicates you're done writing)
unsigned int nextTimestamp () const

Public Attributes

Thread::Lock pidLock
PIDUpdate pidValues [NumOutputs]
unsigned int dirtyPIDs

Protected Types

enum  LedState { LED_OFF = 0, LED_ON, LED_UNKNOWN }

Protected Member Functions

virtual bool launched ()
virtual void cancelled ()
void clearBuffer ()
virtual unsigned int runloop ()
template<class T >
void readResponse (T &response, std::istream &is, ServoInfo &module)
virtual void updateCommands (std::istream &is, std::ostream &os)
DynamixelProtocol::SyncWritePosSpeedEntry setServo (const servo_iterator &servo, ServoInfo::RotationMode rm, float v, float speed)
 converts the value v from radians into the specified servo's range, with expected speed (rad/s)
bool 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

const plist::Primitive
< std::string > & 
commName
plist::DictionaryOf< ServoInfo > & servos
DynamixelDriverdriver
std::vector< ServoInfo * > servoPollQueue
 priority queue of servos waiting to be polled for sensor information
FailsafeThread failsafe
bool continuousUpdates
bool updated
bool responsePending
unsigned int lastSensorTime
float servoDeflection
 'tics' of servo deflection from target per newton·meter of torque applied
bool isFirstCheck
float outputBufA [NumOutputs]
unsigned int timestampBufA
float outputBufB [NumOutputs]
unsigned int timestampBufB
float outputBufC [NumOutputs]
unsigned int timestampBufC
float lastOutputs [NumOutputs]
floatcurBuf
float ledActivation [NumLEDs]
 used to track partial LED activation (see calcLEDValue())
enum
DynamixelDriver::CommThread::LedState 
lastLEDState [NumLEDs]
 keeps track of the last full activation value sent to servo

Private Member Functions

 CommThread (const CommThread &)
 don't copy
CommThreadoperator= (const CommThread &)
 don't assign

Member Enumeration Documentation

enum LedState [protected]
Enumerator:
LED_OFF 
LED_ON 
LED_UNKNOWN 

Definition at line 381 of file Dynamixel.h.


Constructor & Destructor Documentation

CommThread ( plist::DictionaryOf< ServoInfo > &  servoList,
const plist::Primitive< std::string > &  comm,
DynamixelDriver parent 
)

Definition at line 272 of file Dynamixel.h.

~CommThread (  ) 

Definition at line 283 of file Dynamixel.h.

CommThread ( const CommThread  )  [private]

don't copy


Member Function Documentation

bool calcLEDValue ( unsigned int  i,
float  x 
) [protected]

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

Definition at line 362 of file Dynamixel.h.

Referenced by CommThread::updateCommands().

void cancelled (  )  [protected, virtual]

Reimplemented from Thread.

Definition at line 461 of file Dynamixel.cc.

void clearBuffer (  )  [protected]

Definition at line 492 of file Dynamixel.cc.

Referenced by CommThread::cancelled().

float * getWriteBuffer (  ) 

find the oldest of the output buffers that isn't currently in use

Definition at line 409 of file Dynamixel.cc.

Referenced by DynamixelDriver::motionCheck().

bool launched (  )  [protected, virtual]

Reimplemented from Thread.

Definition at line 454 of file Dynamixel.cc.

unsigned int nextTimestamp (  )  const

Definition at line 323 of file Dynamixel.h.

Referenced by DynamixelDriver::nextTimestamp().

CommThread& operator= ( const CommThread  )  [private]

don't assign

virtual void plistCollectionEntriesChanged ( Collection &   )  [virtual]

Definition at line 299 of file Dynamixel.h.

Referenced by CommThread::CommThread().

virtual void plistCollectionEntryAdded ( Collection &  ,
ObjectBase &  primitive 
) [virtual]

Definition at line 285 of file Dynamixel.h.

virtual void plistCollectionEntryRemoved ( Collection &  ,
ObjectBase &  primitive 
) [virtual]

Definition at line 293 of file Dynamixel.h.

void readResponse ( T response,
std::istream &  is,
ServoInfo module 
) [protected]

Definition at line 427 of file Dynamixel.h.

Referenced by CommThread::runloop().

unsigned int runloop (  )  [protected, virtual]

Reimplemented from Thread.

Definition at line 510 of file Dynamixel.cc.

DynamixelProtocol::SyncWritePosSpeedEntry setServo ( const servo_iterator servo,
ServoInfo::RotationMode  rm,
float  v,
float  speed 
) [protected]

converts the value v from radians into the specified servo's range, with expected speed (rad/s)

Definition at line 953 of file Dynamixel.cc.

Referenced by CommThread::updateCommands().

void setWriteBufferTimestamp ( float buf  ) 

sets the timestamp on the indicated buffer (indicates you're done writing)

Definition at line 443 of file Dynamixel.cc.

Referenced by DynamixelDriver::motionCheck().

virtual void start (  )  [virtual]
virtual void startOneUpdate (  )  [virtual]

Definition at line 312 of file Dynamixel.h.

bool takeUpdate (  ) 

Definition at line 316 of file Dynamixel.h.

Referenced by DynamixelDriver::advance().

void updateCommands ( std::istream &  is,
std::ostream &  os 
) [protected, virtual]

Definition at line 741 of file Dynamixel.cc.

Referenced by CommThread::runloop().

void waitForUpdate (  )  [virtual]

Definition at line 397 of file Dynamixel.cc.


Member Data Documentation

const plist::Primitive<std::string>& commName [protected]

Definition at line 340 of file Dynamixel.h.

Referenced by CommThread::clearBuffer(), and CommThread::runloop().

bool continuousUpdates [protected]

Definition at line 345 of file Dynamixel.h.

Referenced by CommThread::runloop(), CommThread::start(), and CommThread::startOneUpdate().

float* curBuf [protected]

Definition at line 359 of file Dynamixel.h.

Referenced by CommThread::getWriteBuffer(), and CommThread::updateCommands().

unsigned int dirtyPIDs

Definition at line 327 of file Dynamixel.h.

Referenced by CommThread::updateCommands(), and DynamixelDriver::updatePIDs().

bool isFirstCheck [protected]

Definition at line 351 of file Dynamixel.h.

Referenced by CommThread::launched(), and CommThread::updateCommands().

keeps track of the last full activation value sent to servo

Referenced by CommThread::CommThread(), and CommThread::updateCommands().

float lastOutputs[NumOutputs] [protected]

Definition at line 358 of file Dynamixel.h.

Referenced by CommThread::updateCommands().

unsigned int lastSensorTime [protected]

Definition at line 348 of file Dynamixel.h.

Referenced by CommThread::nextTimestamp(), and CommThread::runloop().

float ledActivation[NumLEDs] [protected]

used to track partial LED activation (see calcLEDValue())

Definition at line 380 of file Dynamixel.h.

Referenced by CommThread::calcLEDValue().

PIDUpdate pidValues[NumOutputs]

Definition at line 326 of file Dynamixel.h.

Referenced by CommThread::updateCommands(), and DynamixelDriver::updatePIDs().

bool responsePending [protected]

Definition at line 347 of file Dynamixel.h.

Referenced by CommThread::cancelled(), and CommThread::runloop().

float servoDeflection [protected]

'tics' of servo deflection from target per newton·meter of torque applied

Definition at line 349 of file Dynamixel.h.

std::vector<ServoInfo*> servoPollQueue [protected]

priority queue of servos waiting to be polled for sensor information

Definition at line 343 of file Dynamixel.h.

Referenced by CommThread::cancelled(), CommThread::plistCollectionEntriesChanged(), CommThread::plistCollectionEntryAdded(), CommThread::plistCollectionEntryRemoved(), and CommThread::runloop().

unsigned int timestampBufA [protected]
unsigned int timestampBufB [protected]
unsigned int timestampBufC [protected]

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