00001 00002 // 00003 //Contents: Class CJacobian: a class to compute Jacobian Matrix 00004 // 00006 00007 #ifndef CJACOBIAN_H 00008 #define CJACOBIAN_H 00009 00010 #include "robots/robotbase.h" 00011 #include "Configuration.h" 00012 00013 class VectorN; 00014 00015 class CJacobian 00016 { 00017 public: 00018 CJacobian(RobotBase& robot); 00019 ~CJacobian(); 00020 00021 // Determine physical velocity by joint velocity 00022 bool GetPhyVelocity(VectorN& phyVel, VectorN& jointVel); 00023 00024 // Determine joint velocity by physical velocity 00025 bool GetJointVelocity(VectorN& jointVel, VectorN& phyVel); 00026 00027 // Given a joint regarded as wrist, and relative position 00028 bool SetInterestPoint(int joint, Frame& endFrame, bool position=true, bool orient=false, int baseJoint=0); 00029 00030 // Jacobian matrix updated for configuration 00031 bool SetConfiguration(Configuration& conf); 00032 00033 Frame GetJointFrame(int nJoint) const; 00034 Frame GetJointWorldFrame(int nJoint) const; 00035 00036 // returns m_pMatrix 00037 Matrixmxn* GetMatrix(); 00038 00039 protected: 00040 int m_nDof; // DOF of entire robot 00041 int m_nJoint; // joint interested 00042 int m_nBaseJoint; // base joint of the planning part 00043 Frame m_frObserve; // point interested related to the joint m_nJoint; 00044 Matrixmxn* m_pMatrix; // actual Jacobian matrix 00045 Matrix4x4* m_pJointMatrix; // transform for every joint; 00046 Vector4* m_pJointZ; // coordinate of joint's Z-axis 00047 Vector4* m_pJointOrig; // coordinate of joint's origin 00048 RobotBase* m_pRobot; // related robot 00049 bool m_bOrientation; // whether consider orientation or not. 00050 bool m_bPosition; // whether consider position or not. 00051 Configuration m_configCurrent;// latest configuration. 00052 00053 bool Calculate(); // calculates Jacobian 00054 bool UpdateJoints(); // Update m_pJointZ/m_pJointOrig 00055 }; 00056 00057 #endif