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
00200 const double& getInertia() const
00201 {
00202 return inertia;
00203 };
00204
00205 virtual ~Joint();
00206
00207 private:
00208 std::string name;
00209 Joint::JointType type;
00210 double scale;
00211 double offset;
00212 double inertia;
00213 double damping;
00214 double stiffness;
00215
00216
00217 Vector axis, origin;
00218 mutable Frame joint_pose;
00219 mutable double q_previous;
00220
00221
00222
00223 class joint_type_exception: public std::exception{
00224 virtual const char* what() const throw(){
00225 return "Joint Type excption";}
00226 } joint_type_ex;
00227
00228 };
00229
00230 }
00231
00232 #endif