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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00058
00059 #define __IKCCD_H__
00060
00061 #include "ForwardKinematics/FKPosition.h"
00062 #include "InverseKinematics/IKPosition.h"
00063
00065 namespace OSCAR {
00066
00072 class IKCCD : public IKPosition, public Kinematics
00073 {
00074
00075 public:
00076
00086 IKCCD(const String& fileName,JointVector& initial_joint,double max_error = 0.1, OSCARError& err = DUMMY_ERROR(noError));
00087
00096 IKCCD(const DHData& dhParams,JointVector& initial_joint,double max_error = 0.1);
00097
00103 virtual ~IKCCD();
00104
00121 bool GetJointPosition(const Xform& desiredHand, JointVector& jointPosition);
00122
00139 bool GetJointPosition(const HandPose& desiredHandPose, JointVector& jointPosition);
00140
00150 void GetJointPosition(JointVector& currentJointPosition) const;
00151
00164 unsigned int GetSolutionProperties() const;
00165
00166
00176 void SetTool(const Xform& toolPose);
00177
00187 void SetTool(const Vector3D& toolPoint);
00188
00198 void SetBase(const Xform& basePose);
00199
00208 void SetBase(const Vector3D& basePoint);
00209
00218 bool SetJointPosition(const JointVector& jointPosition);
00219
00229 void SetMaximumIterations(unsigned int noIterations);
00230
00240 unsigned int GetMaximumIterations(void) const;
00241
00252 bool SetErrorTolerance(double maxError);
00253
00262 bool GetErrorTolerance(double& maxError);
00263
00272 bool SetWeightFactors( Vector &weightA );
00273 bool GetWeightFactors( Vector &weightA );
00274
00275 long SetActiveCoordinates( const bool *activeA );
00276 long GetActiveCoordinates( bool *activeA=NULL );
00277
00278 bool SetOffsets( JointVector &offsetA );
00279 bool GetOffsets( JointVector &offsetA );
00280
00281 bool SetMinMax( JointVector &minA, JointVector &maxA );
00282 bool GetMinMax( JointVector &minA, JointVector &maxA );
00283
00284 virtual void CheckDependencies( JointVector& ) {};
00285
00286 protected:
00287 unsigned int max_iterationM;
00288 unsigned int solutionIterationCount;
00289 double max_errorM;
00290 unsigned int dofM;
00291 Vector weightM;
00292 JointVector offsetM;
00293 JointVector jointsM;
00294 JointVector minM;
00295 JointVector maxM;
00296 bool activeM[6];
00297 FKPosition *forkinM;
00298 };
00299
00300 }
00301 #endif // __IKCCD_H__