00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _mcgrip_h_
00027 #define _mcgrip_h_
00028
00029 #include <vector>
00030
00031 #include "humanHand.h"
00032 #include "grasp.h"
00033
00034 class Matrix;
00035 class Joint;
00036
00038
00067 class McGrip : public HumanHand
00068 {
00069 Q_OBJECT
00070 private:
00071
00073 void assembleTorqueMatrices(int refJointNum, int thisJointNum, int nextJointNum,
00074 double tx, double ty,
00075 double theta, double theta_n,
00076 Matrix &B, Matrix &a);
00077
00079 double mLinkLength;
00081 double mJointRadius;
00082
00083 public:
00085 McGrip(World *w,const char *name);
00086
00088 void getRoutingMatrices(Matrix **B, Matrix **a);
00089
00091 void getJointDisplacementMatrix(Matrix **J);
00092
00094 double getLinkLength() const {return mLinkLength;}
00095
00097 double getJointRadius() const {return mJointRadius;}
00098
00100 virtual int loadFromXml(const TiXmlElement* root,QString rootPath);
00101
00103 int jointTorqueEquilibrium();
00104 };
00105
00107 class McGripGrasp : public Grasp
00108 {
00109 Q_OBJECT
00110 public:
00112 McGripGrasp(Hand *h) : Grasp(h) {
00113 assert(h->isA("McGrip"));
00114 }
00115
00117 int tendonAndHandOptimization(Matrix *parameters, double &objValRet);
00118
00120 int computeQuasistaticForces(double tendonForce);
00121 };
00122
00123 #endif