Blender  V3.3
joint.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
2 
3 // Version: 1.0
4 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
5 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
6 // URL: http://www.orocos.org/kdl
7 
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef KDL_JOINT_HPP
23 #define KDL_JOINT_HPP
24 
25 #include "frames.hpp"
26 #include <string>
27 
28 namespace KDL {
29 
43  class Joint {
44  public:
59  Joint(const JointType& type=None,const double& scale=1,const double& offset=0,
60  const double& inertia=0,const double& damping=0,const double& stiffness=0);
61  Joint(const Joint& in);
62 
63  Joint& operator=(const Joint& arg);
64 
73  Frame pose(const double* q)const;
81  Twist twist(const double& qdot, int dof=0)const;
82 
88  const JointType& getType() const
89  {
90  return type;
91  };
92 
98  const std::string getTypeName() const
99  {
100  switch (type) {
101  case RotX:
102  return "RotX";
103  case RotY:
104  return "RotY";
105  case RotZ:
106  return "RotZ";
107  case TransX:
108  return "TransX";
109  case TransY:
110  return "TransY";
111  case TransZ:
112  return "TransZ";
113  case Sphere:
114  return "Sphere";
115  case Swing:
116  return "Swing";
117  case None:
118  return "None";
119  default:
120  return "None";
121  }
122  };
123  unsigned int getNDof() const;
124 
125  virtual ~Joint();
126 
127  private:
128  Joint::JointType type;
129  double scale;
130  double offset;
131  double inertia;
132  double damping;
133  double stiffness;
134  };
135 
136 } // end of namespace KDL
137 
138 #endif
represents a frame transformation in 3D space (rotation + translation)
Definition: frames.hpp:526
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition: joint.hpp:43
Joint(const JointType &type=None, const double &scale=1, const double &offset=0, const double &inertia=0, const double &damping=0, const double &stiffness=0)
Definition: joint.cpp:29
Twist twist(const double &qdot, int dof=0) const
Definition: joint.cpp:104
const std::string getTypeName() const
Definition: joint.hpp:98
@ Sphere
Definition: joint.hpp:45
@ TransZ
Definition: joint.hpp:45
@ TransY
Definition: joint.hpp:45
@ TransX
Definition: joint.hpp:45
virtual ~Joint()
Definition: joint.cpp:54
Joint & operator=(const Joint &arg)
Definition: joint.cpp:42
unsigned int getNDof() const
Definition: joint.cpp:149
Frame pose(const double *q) const
Definition: joint.cpp:58
const JointType & getType() const
Definition: joint.hpp:88
represents both translational and rotational velocities.
Definition: frames.hpp:679
Definition: chain.cpp:27