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
00033
00034 #ifndef IKJDLS_h
00035 #define IKJDLS_h
00036
00037 #include "ForwardKinematics/FKJacobianMitsubishiPA-10.h"
00038 #include "InverseKinematics/IKJacobian.h"
00039 #include "InverseKinematics/IKErrors.h"
00040 #include "Math/DLSEqnSolver.h"
00041
00043 namespace OSCAR {
00044
00056 template <class JacobianType=FKJacobian>
00057 class IKJDLS : public IKJacobian<JacobianType>
00058 {
00059 public:
00060
00077 IKJDLS(const JointVector& initialJointPosition,
00078 JacobianType *fk,
00079 DLSEqnSolver* solver,
00080 OSCARError& err = DUMMY_ERROR(noError));
00081
00082 virtual ~IKJDLS();
00083
00096 virtual bool GetJointPosition(const Xform& desiredHandMatrix, JointVector &jointPosition);
00097
00110 virtual bool GetJointPosition(const HandPose& desiredHand, JointVector& jointPosition);
00111
00128 virtual bool GetDifferentialJointPosition(const Xform& desiredHandMatrix, JointVector& differentialJointPosition);
00129
00146 virtual bool GetDifferentialJointPosition(const HandPose& desiredHand, JointVector& differentialJointPosition);
00147
00159 virtual bool GetJointVelocity(const HandPose& handVelocity, JointVector& jointVelocitySolution);
00160
00171 void SetMaxDampingFactor(double maxDamping);
00172
00185 bool SetErrorTolerances(double maxTransError, double maxRotError);
00186
00195 bool GetErrorTolerances(double& maxTransError, double& maxRotError) const;
00196
00197
00198 protected:
00199 double maxDamping, maxTransError, maxRotError;
00200 double transError, rotError;
00201
00202 bool converge(const Xform& desiredHandMatrix);
00203 double calculateErrorMagnitude(const Xform& desired,
00204 const Xform* current,
00205 HandPose& error);
00206 void computeDamping();
00207 };
00208
00209 #include "InverseKinematics/IKJDLS.ipp"
00210 }
00211
00212
00213 #endif // IKJDLS_h