Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekateros::SyncMoveMsgs Class Reference

Container class to hold Dynamixel synchronous messages data. More...

#include <hekKinJoint.h>

Public Member Functions

 SyncMoveMsgs ()
 Default constructor.
 
virtual ~SyncMoveMsgs ()
 Destructor.
 
void clear ()
 Clear sync messages.
 
int addSpeed (int nServoId, int nServoSpeed)
 Add servo speed to speed tuple array. More...
 
int addOdPos (int nServoId, int nServoPos)
 Add servo position to position tuple array. More...
 
uint_t getSpeedTupleCount ()
 Get the number of added speed tuples to speed tuple array. More...
 
DynaSpeedTuple_T * getSpeedTuples ()
 Get the speed tuple array. More...
 
uint_t getOdPosTupleCount ()
 Get the number of added position tuples to position tuple array. More...
 
DynaPosTuple_T * getOdPosTuples ()
 Get the position tuple array. More...
 

Protected Attributes

DynaSpeedTuple_T m_tupSpeed [DYNA_ID_NUMOF]
 speed tuple array
 
uint_t m_uSpeedTupCount
 speed tuple count
 
DynaPosTuple_T m_tupOdPos [DYNA_ID_NUMOF]
 position tuple array
 
uint_t m_uOdPosTupCount
 positon tuple count
 

Detailed Description

Container class to hold Dynamixel synchronous messages data.

Definition at line 93 of file hekKinJoint.h.

Member Function Documentation

int SyncMoveMsgs::addOdPos ( int  nServoId,
int  nServoPos 
)

Add servo position to position tuple array.

Parameters
nServoIdServo id.
nServoPosServo position (odometer ticks).
Returns
On success, returns index of added tuple of position tuple array. On failures, -1.

Definition at line 125 of file hekKinJoint.cxx.

Referenced by hekateros::HekKinJoint::addServoMsgEntries(), and ~SyncMoveMsgs().

126 {
127  int index;
128 
129  if( m_uOdPosTupCount < DYNA_ID_NONE )
130  {
131  index = (int)m_uOdPosTupCount++;
132  m_tupOdPos[index].m_nServoId = nServoId;
133  m_tupOdPos[index].m_nPos = nServoPos;
134  }
135  else
136  {
137  index = -1;
138  }
139 
140  return index;
141 }
DynaPosTuple_T m_tupOdPos[DYNA_ID_NUMOF]
position tuple array
Definition: hekKinJoint.h:180
uint_t m_uOdPosTupCount
positon tuple count
Definition: hekKinJoint.h:181
int SyncMoveMsgs::addSpeed ( int  nServoId,
int  nServoSpeed 
)

Add servo speed to speed tuple array.

Parameters
nServoIdServo id.
nServoSpeedServo speed (raw unitless).
Returns
On success, returns index of added tuple of speed tuple array. On failures, -1.

Definition at line 107 of file hekKinJoint.cxx.

Referenced by hekateros::HekKinJoint::addServoMsgEntries(), and ~SyncMoveMsgs().

108 {
109  int index;
110 
111  if( m_uSpeedTupCount < DYNA_ID_NONE )
112  {
113  index = (int)m_uSpeedTupCount++;
114  m_tupSpeed[index].m_nServoId = nServoId;
115  m_tupSpeed[index].m_nSpeed = nServoSpeed;
116  }
117  else
118  {
119  index = -1;
120  }
121 
122  return index;
123 }
DynaSpeedTuple_T m_tupSpeed[DYNA_ID_NUMOF]
speed tuple array
Definition: hekKinJoint.h:178
uint_t m_uSpeedTupCount
speed tuple count
Definition: hekKinJoint.h:179
uint_t hekateros::SyncMoveMsgs::getOdPosTupleCount ( )
inline

Get the number of added position tuples to position tuple array.

Returns
Count.

Definition at line 162 of file hekKinJoint.h.

References m_uOdPosTupCount.

163  {
164  return m_uOdPosTupCount;
165  }
uint_t m_uOdPosTupCount
positon tuple count
Definition: hekKinJoint.h:181
DynaPosTuple_T* hekateros::SyncMoveMsgs::getOdPosTuples ( )
inline

Get the position tuple array.

Returns
Pointer.

Definition at line 172 of file hekKinJoint.h.

References m_tupOdPos.

173  {
174  return m_tupOdPos;
175  }
DynaPosTuple_T m_tupOdPos[DYNA_ID_NUMOF]
position tuple array
Definition: hekKinJoint.h:180
uint_t hekateros::SyncMoveMsgs::getSpeedTupleCount ( )
inline

Get the number of added speed tuples to speed tuple array.

Returns
Count.

Definition at line 142 of file hekKinJoint.h.

References m_uSpeedTupCount.

143  {
144  return m_uSpeedTupCount;
145  }
uint_t m_uSpeedTupCount
speed tuple count
Definition: hekKinJoint.h:179
DynaSpeedTuple_T* hekateros::SyncMoveMsgs::getSpeedTuples ( )
inline

Get the speed tuple array.

Returns
Pointer.

Definition at line 152 of file hekKinJoint.h.

References m_tupSpeed.

153  {
154  return m_tupSpeed;
155  }
DynaSpeedTuple_T m_tupSpeed[DYNA_ID_NUMOF]
speed tuple array
Definition: hekKinJoint.h:178

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