00001 #ifndef SIGEL_ROBOT_SIG_JOINT_H
00002 #define SIGEL_ROBOT_SIG_JOINT_H
00003
00004 namespace SIGEL_Robot { class SIG_Joint; }
00005
00006 #include <qstring.h>
00007 #include <pointvector.h>
00008 #include "SIGEL_Robot/SIG_Link.h"
00009 #include "SIGEL_Robot/SIG_Robot.h"
00010
00011 namespace SIGEL_Robot
00012 {
00019 class SIG_Joint {
00020 public:
00027 enum JointType { tTranslationalJoint,
00028 tRotationalJoint,
00029 tCylindricalJoint,
00030 tGlueJoint };
00031 protected:
00032 SIG_Robot *parent;
00033 QString name;
00034 int number;
00035 SIG_Link *leftLink, *rightLink;
00036 double mdh_a, mdh_alpha, mdh_d, mdh_theta;
00037 double mdh_screw_d, mdh_screw_theta, mechsMinPos, mechsMaxPos;
00038 int mdh_predecessor_is_left;
00039
00040 public:
00045 SIG_Joint(SIG_Robot *par, QString n, int nr);
00054 SIG_Joint (SIG_Robot *par, QTextStream & tx);
00058 virtual ~SIG_Joint (void);
00062 QString getName (void) const;
00066 int getNumber (void) const;
00071 virtual JointType getJointType (void) const = 0;
00077 void setLeftLink (SIG_Link *thelink);
00081 void setRightLink (SIG_Link *thelink);
00085 SIG_Link const *getLeftLink() const;
00089 SIG_Link const *getRightLink() const;
00094 SIG_Link *otherSide (SIG_Link *myself) const;
00099 virtual void transformPoints (SIG_Link *side,
00100 DL_vector mov, DL_matrix rot) =0;
00107 virtual void getGeomRelation
00108 (DL_vector &t, DL_matrix &o, SIG_Link *origin) = 0;
00114 virtual void getMDH (SIG_Link * & predecessor,
00115 double & a, double & alpha,
00116 double & d, double & theta,
00117 double & screwD, double & screwTheta);
00118
00119 double getMechsMinPos() const;
00120
00121 double getMechsMaxPos() const;
00122
00126 virtual void writeToFileTransfer (QTextStream &tx);
00127
00128 void transformToDynaMechs( SIG_Link *predecessor,
00129 double screwD,
00130 double screwTheta );
00131
00132 bool continuable( SIG_Link *predecessor ) const;
00133
00134 void calculateMDH( SIG_Link *caller );
00135
00136 static void calculateCut( DL_vector a,
00137 DL_vector u,
00138 DL_vector v,
00139 DL_vector b,
00140 DL_vector w,
00141 DL_vector &cut );
00142
00143 static double normalizeRadAngle( double input );
00144
00145 protected:
00149 void tfap (DL_vector mov, DL_matrix rot, DL_vector *p);
00150 };
00151 }
00152
00153 #endif // SIGEL_ROBOT_SIG_JOINT_H