Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

IKJDLS.h

Go to the documentation of this file.
00001 
00002 //      Title       :  IKJDLS.h
00003 //      Project     :  Trauma Pod
00004 //      Created     :  02/20/2005 12:53:41 PM
00005 //      Author      :  Chalongrath Pholsiri
00006 //      Platforms   :  All
00007 //      Copyright   :  Copyright© The University of Texas at Austin, 2002. All rights reserved.
00008 //                 
00009 //                 This software and documentation constitute an unpublished work
00010 //                 and contain valuable trade secrets and proprietary information
00011 //                 belonging to University.  None of the foregoing material may be
00012 //                 copied  or duplicated or disclosed without the express, written
00013 //                 permission of University.  UNIVERSITY EXPRESSLY DISCLAIMS ANY
00014 //                 AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION,
00015 //                 INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00016 //                 PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY
00017 //                 THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
00018 //                 NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF
00019 //                 THE SOFTWARE OR DOCUMENTATION.  Under no circumstances shall
00020 //                 University be liable for incidental, special, indirect, direct or
00021 //                 consequential damages or loss of profits, interruption of business,
00022 //                 or related expenses which may arise from use of software or documentation,
00023 //                 including but not limited to those resulting from defects in software
00024 //                 and/or documentation, or loss or inaccuracy of data of any kind.
00025 //
00026 //              Purpose     :  Inverse kinematics using Damped Least Square technique
00027 //-----------------------------------------------------------------------------
00028 //
00029 //              $Revisions$
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
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations