Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KDL_JOINT_HPP
00023 #define KDL_JOINT_HPP
00024
00025 #include "frames.hpp"
00026 #include <string>
00027 #include <exception>
00028
00029
00030 namespace KDL {
00031
00045 class Joint {
00046 public:
00047 typedef enum { RotAxis,RotX,RotY,RotZ,TransAxis,TransX,TransY,TransZ,None} JointType;
00062 explicit Joint(const std::string& name, const JointType& type=None,const double& scale=1,const double& offset=0,
00063 const double& inertia=0,const double& damping=0,const double& stiffness=0);
00077 explicit Joint(const JointType& type=None,const double& scale=1,const double& offset=0,
00078 const double& inertia=0,const double& damping=0,const double& stiffness=0);
00094 Joint(const std::string& name, const Vector& _origin, const Vector& _axis, const JointType& type, const double& _scale=1, const double& _offset=0,
00095 const double& _inertia=0, const double& _damping=0, const double& _stiffness=0);
00110 Joint(const Vector& _origin, const Vector& _axis, const JointType& type, const double& _scale=1, const double& _offset=0,
00111 const double& _inertia=0, const double& _damping=0, const double& _stiffness=0);
00112
00121 Frame pose(const double& q)const;
00129 Twist twist(const double& qdot)const;
00130
00136 Vector JointAxis() const;
00137
00143 Vector JointOrigin() const;
00150 const std::string& getName()const
00151 {
00152 return name;
00153 }
00159 const JointType& getType() const
00160 {
00161 return type;
00162 };
00163
00169 const std::string getTypeName() const
00170 {
00171 switch (type) {
00172 case RotAxis:
00173 return "RotAxis";
00174 case TransAxis:
00175 return "TransAxis";
00176 case RotX:
00177 return "RotX";
00178 case RotY:
00179 return "RotY";
00180 case RotZ:
00181 return "RotZ";
00182 case TransX:
00183 return "TransX";
00184 case TransY:
00185 return "TransY";
00186 case TransZ:
00187 return "TransZ";
00188 case None:
00189 return "None";
00190 default:
00191 return "None";
00192 }
00193 };
00194
00195 virtual ~Joint();
00196
00197 private:
00198 std::string name;
00199 Joint::JointType type;
00200 double scale;
00201 double offset;
00202 double inertia;
00203 double damping;
00204 double stiffness;
00205
00206
00207 Vector axis, origin;
00208 mutable Frame joint_pose;
00209 mutable double q_previous;
00210
00211
00212
00213 class joint_type_exception: public std::exception{
00214 virtual const char* what() const throw(){
00215 return "Joint Type excption";}
00216 } joint_type_ex;
00217
00218 };
00219
00220 }
00221
00222 #endif