Blender V2.61 - r43446

joint.hpp

Go to the documentation of this file.
00001 // Copyright  (C)  2007  Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
00002 
00003 // Version: 1.0
00004 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
00005 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
00006 // URL: http://www.orocos.org/kdl
00007 
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Lesser General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2.1 of the License, or (at your option) any later version.
00012 
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Lesser General Public License for more details.
00017 
00018 // You should have received a copy of the GNU Lesser General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021 
00022 #ifndef KDL_JOINT_HPP
00023 #define KDL_JOINT_HPP
00024 
00025 #include "frames.hpp"
00026 #include <string>
00027 
00028 namespace KDL {
00029 
00043     class Joint {
00044     public:
00045         typedef enum { RotX,RotY,RotZ,TransX,TransY,TransZ,Sphere,Swing,None} JointType;
00059         Joint(const JointType& type=None,const double& scale=1,const double& offset=0,
00060               const double& inertia=0,const double& damping=0,const double& stiffness=0);
00061         Joint(const Joint& in);
00062 
00063         Joint& operator=(const Joint& arg);
00064 
00073         Frame pose(const double& q)const;
00081         Twist twist(const double& qdot, int dof=0)const;
00082 
00088         const JointType& getType() const
00089         {
00090             return type;
00091         };
00092 
00098         const std::string getTypeName() const
00099         {
00100             switch (type) {
00101             case RotX:
00102                 return "RotX";
00103             case RotY:
00104                 return "RotY";
00105             case RotZ:
00106                 return "RotZ";
00107             case TransX:
00108                 return "TransX";
00109             case TransY:
00110                 return "TransY";
00111             case TransZ:
00112                 return "TransZ";
00113             case Sphere:
00114                 return "Sphere";
00115             case Swing:
00116                 return "Swing";
00117             case None:
00118                 return "None";
00119             default:
00120                 return "None";
00121             }
00122         };
00123         unsigned int getNDof() const;
00124 
00125         virtual ~Joint();
00126 
00127     private:
00128         Joint::JointType type;
00129         double scale;
00130         double offset;
00131         double inertia;
00132         double damping;
00133         double stiffness;
00134     };
00135 
00136 } // end of namespace KDL
00137 
00138 #endif