00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _IKBASE_H_
00023 #define _IKBASE_H_
00024
00025
00026 #include "common/exception.h"
00027 #include "common/dllexport.h"
00028
00029 #include "KNI/kmlExt.h"
00030 #include "KNI/kmlCommon.h"
00031
00032 #include "KNI_InvKin/KatanaKinematics.h"
00033
00034 #include <vector>
00035 #include <memory>
00036
00037
00038
00039 #ifndef TM_ENDLESS
00040 #define TM_ENDLESS -1
00041 #endif
00042
00043
00044 class DLLDIR_IK CikBase : public CKatana {
00045
00046 private:
00047 std::auto_ptr<KNI::KatanaKinematics> _kinematicsImpl;
00048 bool _kinematicsIsInitialized;
00049 void _initKinematics();
00050
00051 public:
00052
00053 CikBase() : _kinematicsIsInitialized(false) { };
00054 ~CikBase() {}
00055
00058 void DKApos(double* position);
00059
00064 void getCoordinates(double& x, double& y, double& z, double& phi, double& theta, double& psi, bool refreshEncoders = true);
00065
00069 void IKCalculate(double X,
00070 double Y,
00071 double Z,
00072 double Al,
00073 double Be,
00074 double Ga,
00075 std::vector<int>::iterator solution_iter);
00076
00080 void IKCalculate(double X,
00081 double Y,
00082 double Z,
00083 double Al,
00084 double Be,
00085 double Ga,
00086 std::vector<int>::iterator solution_iter,
00087 const std::vector<int>& actualPosition );
00088
00091 void IKGoto(double X,
00092 double Y,
00093 double Z,
00094 double Al,
00095 double Be,
00096 double Ga,
00097 bool wait = false,
00098 int tolerance = 100,
00099 long timeout = TM_ENDLESS);
00100
00103 void moveRobotTo(double x,
00104 double y,
00105 double z,
00106 double phi,
00107 double theta,
00108 double psi,
00109 bool waitUntilReached = false, int waitTimeout = TM_ENDLESS);
00110
00115 void moveRobotTo( std::vector<double> coordinates, bool waitUntilReached = false, int waitTimeout = TM_ENDLESS);
00116
00117 };
00118
00119
00120 #endif //_IKBASE_H_
00121