52 #include "rnr/rnrconfig.h" 54 #include "Dynamixel/Dynamixel.h" 68 m_eProdFamily = HekProdFamilyUnknown;
69 m_eProdId = HekProdIdUnknown;
81 int HekSpec::set(
int eProdId, uint_t uHwVer)
95 case HekProdArm5LBetaId:
101 m_nNumLinks = HekProdArm4LNumLinks;
102 m_nDoF = HekProdArm4LDoF;
103 m_nNumOptLimits = HekProdArm4LNumOptLimits;
104 m_nNumServos = HekProdArm4LNumServos;
107 pSpecLinks = HekProdArm4LSpecLinks;
108 pSpecJoints = HekProdArm4LSpecJoints_1_1;
109 pSpecServos = HekProdArm4LSpecServos_1_1;
113 LOGWARN(
"Unsupported 4L v%u.%u.%u, defaulting to v1.1 specs.",
115 pSpecLinks = HekProdArm4LSpecLinks;
116 pSpecJoints = HekProdArm4LSpecJoints_1_1;
117 pSpecServos = HekProdArm4LSpecServos_1_1;
119 LOGDIAG3(
"Hekateros 4L v%u.%u.%u specification loaded.",
126 m_nNumLinks = HekProdArm5LNumLinks;
127 m_nDoF = HekProdArm5LDoF;
128 m_nNumOptLimits = HekProdArm5LNumOptLimits;
129 m_nNumServos = HekProdArm5LNumServos;
132 pSpecLinks = HekProdArm5LSpecLinks;
133 pSpecJoints = HekProdArm5LSpecJoints_1_1;
134 pSpecServos = HekProdArm5LSpecServos_1_1;
138 pSpecLinks = HekProdArm5LSpecLinks;
139 pSpecJoints = HekProdArm5LSpecJoints_1_2;
140 pSpecServos = HekProdArm5LSpecServos_1_2;
146 pSpecLinks = HekProdArm5LSpecLinks;
147 pSpecJoints = HekProdArm5LSpecJoints_1_3_5;
148 pSpecServos = HekProdArm5LSpecServos_1_3_5;
152 pSpecLinks = HekProdArm5LSpecLinks;
153 pSpecJoints = HekProdArm5LSpecJoints_1_3;
154 pSpecServos = HekProdArm5LSpecServos_1_3;
159 pSpecLinks = HekProdArm5LSpecLinks;
160 pSpecJoints = HekProdArm5LSpecJoints_1_4;
161 pSpecServos = HekProdArm5LSpecServos_1_4;
165 pSpecLinks = HekProdArm5LSpecLinks;
166 pSpecJoints = HekProdArm5LSpecJoints_2_0;
167 pSpecServos = HekProdArm5LSpecServos_2_0;
171 LOGWARN(
"Unsupported 5L v%u.%u.%u, defaulting to v1.3 specs.",
173 pSpecLinks = HekProdArm5LSpecLinks;
174 pSpecJoints = HekProdArm5LSpecJoints_1_3;
175 pSpecServos = HekProdArm5LSpecServos_1_3;
177 LOGDIAG3(
"Hekateros 5L v%u.%u.%u specification loaded.",
184 case HekProdEEGraboidId:
185 m_eProdFamily = HekProdEEGraboidFamily;
186 m_nNumLinks = HekProdEEGraboidNumLinks;
187 m_nDoF = HekProdEEGraboidDoF;
188 m_nNumOptLimits = HekProdEEGraboidNumOptLimits;
189 m_nNumServos = HekProdEEGraboidNumServos;
192 pSpecLinks = HekProdEEGraboidSpecLinks;
193 pSpecJoints = HekProdEEGraboidSpecJoints_1_0;
194 pSpecServos = HekProdEEGraboidSpecServos_1_0;
198 pSpecLinks = HekProdEEGraboidSpecLinks;
199 pSpecJoints = HekProdEEGraboidSpecJoints_1_1;
200 pSpecServos = HekProdEEGraboidSpecServos_1_1;
204 LOGWARN(
"Unsupported Graboid EE v%u.%u.%u, " 205 "defaulting to v1.1 specs.",
207 pSpecLinks = HekProdEEGraboidSpecLinks;
208 pSpecJoints = HekProdEEGraboidSpecJoints_1_1;
209 pSpecServos = HekProdEEGraboidSpecServos_1_1;
211 LOGDIAG3(
"Graboid EE v%u.%u.%u specification loaded.",
217 LOGERROR(
"0x%08x: Unknown or unsupported product id.", eProdId);
218 return -HEK_ECODE_BAD_VAL;
221 if( pSpecLinks != NULL )
223 for(i=0; i<m_nNumLinks; ++i)
225 m_vecSpecLinks.push_back(pSpecLinks[i]);
229 if( pSpecJoints != NULL )
231 for(i=0; i<m_nDoF; ++i)
233 m_vecSpecJoints.push_back(pSpecJoints[i]);
237 if( pSpecServos != NULL )
239 for(i=0; i<m_nNumServos; ++i)
241 m_vecSpecServos.push_back(pSpecServos[i]);
251 void HekSpec::clear()
253 m_eProdId = HekProdIdUnknown;
255 m_vecSpecLinks.clear();
256 m_vecSpecJoints.clear();
257 m_vecSpecServos.clear();
262 vector<HekSpecJoint_T>::iterator iter;
264 for(iter = m_vecSpecJoints.begin(); iter != m_vecSpecJoints.end(); ++iter)
266 if( iter->m_strName == strName )
277 vector<HekSpecJoint_T>::iterator iter;
279 for(iter = m_vecSpecJoints.begin(); iter != m_vecSpecJoints.end(); ++iter)
281 if( iter->m_nMasterServoId == nServoId )
292 vector<HekSpecServo_T>::iterator iter;
294 for(iter = m_vecSpecServos.begin(); iter != m_vecSpecServos.end(); ++iter)
296 if( iter->m_nServoId == nServoId )
305 bool HekSpec::hasServo(
int nServoId)
307 vector<HekSpecServo_T>::iterator iter;
309 for(iter = m_vecSpecServos.begin(); iter != m_vecSpecServos.end(); ++iter)
311 if( iter->m_nServoId == nServoId )
#define HEK_VER_REV(ver)
Get revision number from version.
#define HEK_VER_MAJOR(ver)
Get version major number from version.
Aggregate of supported <b><i>Hekateros</i></b> auxiliary add-ons static specifications.
Aggregate of supported <b><i>Hekateros</i></b> end effectors static specifications.
#define HEK_ARM_FAMILY
only 1 family of arm products so define here
Aggregate of supported <b><i>Hekateros</i></b> equipment deck effectors static specifications.
Top-level package include file.
#define HEK_VER_MINOR(ver)
Get version minor number from version.
Robotic link specification.
#define HEK_VERSION(major, minor, revision)
Convert version triplet to integer equivalent.
Robotic joint specification.
Aggregagte of supported Hekateros robotic arms static specifications.
Robotic servo specification.
The <b><i>Hekateros</i></b> namespace encapsulates all <b><i>Hekateros</i></b> related constructs...