KDL 1.5.1
Loading...
Searching...
No Matches
joint.hpp
Go to the documentation of this file.
1// Copyright (C) 2007 Ruben Smits <ruben dot smits at intermodalics dot eu>
2
3// Version: 1.0
4// Author: Ruben Smits <ruben dot smits at intermodalics dot eu>
5// Maintainer: Ruben Smits <ruben dot smits at intermodalics dot eu>
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#include <exception>
28
29
30namespace KDL {
31
45 class Joint {
46 public:
62 explicit Joint(const std::string& name, const JointType& type=Fixed,const double& scale=1,const double& offset=0,
63 const double& inertia=0,const double& damping=0,const double& stiffness=0);
77 explicit Joint(const JointType& type=Fixed,const double& scale=1,const double& offset=0,
78 const double& inertia=0,const double& damping=0,const double& stiffness=0);
94 Joint(const std::string& name, const Vector& _origin, const Vector& _axis, const JointType& type, const double& _scale=1, const double& _offset=0,
95 const double& _inertia=0, const double& _damping=0, const double& _stiffness=0);
110 Joint(const Vector& _origin, const Vector& _axis, const JointType& type, const double& _scale=1, const double& _offset=0,
111 const double& _inertia=0, const double& _damping=0, const double& _stiffness=0);
112
121 Frame pose(const double& q)const;
129 Twist twist(const double& qdot)const;
130
136 Vector JointAxis() const;
137
143 Vector JointOrigin() const;
150 const std::string& getName()const
151 {
152 return name;
153 }
159 const JointType& getType() const
160 {
161 return type;
162 };
163
169 const std::string getTypeName() const
170 {
171 switch (type) {
172 case RotAxis:
173 return "RotAxis";
174 case TransAxis:
175 return "TransAxis";
176 case RotX:
177 return "RotX";
178 case RotY:
179 return "RotY";
180 case RotZ:
181 return "RotZ";
182 case TransX:
183 return "TransX";
184 case TransY:
185 return "TransY";
186 case TransZ:
187 return "TransZ";
188 case Fixed:
189 return "Fixed";
190 default:
191 return "Fixed";
192 }
193 };
194
200 const double& getInertia() const
201 {
202 return inertia;
203 };
204
210 const double& getDamping() const
211 {
212 return damping;
213 };
214
220 const double& getStiffness() const
221 {
222 return stiffness;
223 };
224
225 virtual ~Joint();
226
227 private:
228 std::string name;
230 double scale;
231 double offset;
232 double inertia;
233 double damping;
234 double stiffness;
235
236 // variables for RotAxis joint
239 mutable double q_previous;
240
241
242
243 class joint_type_exception: public std::exception{
244 virtual const char* what() const throw(){
245 return "Joint Type excption";}
247
248 };
249
250} // end of namespace KDL
251
252#endif
Definition: frames.hpp:570
Definition: joint.hpp:243
virtual const char * what() const
Definition: joint.hpp:244
Definition: joint.hpp:45
const double & getStiffness() const
Request the stiffness of the joint.
Definition: joint.hpp:220
std::string name
Definition: joint.hpp:228
Vector JointOrigin() const
Request the Vector corresponding to the origin of a revolute joint.
Definition: joint.cpp:157
double q_previous
Definition: joint.hpp:239
double inertia
Definition: joint.hpp:232
Twist twist(const double &qdot) const
Request the resulting 6D-velocity with a joint velocity qdot.
Definition: joint.cpp:106
double scale
Definition: joint.hpp:230
const double & getDamping() const
Request the damping of the joint.
Definition: joint.hpp:210
Vector JointAxis() const
Request the Vector corresponding to the axis of a revolute joint.
Definition: joint.cpp:131
double damping
Definition: joint.hpp:233
const std::string getTypeName() const
Request the stringified type of the joint.
Definition: joint.hpp:169
KDL::Joint::joint_type_exception joint_type_ex
double offset
Definition: joint.hpp:231
Vector axis
Definition: joint.hpp:237
const std::string & getName() const
Request the name of the joint.
Definition: joint.hpp:150
const double & getInertia() const
Request the inertia of the joint.
Definition: joint.hpp:200
Vector origin
Definition: joint.hpp:237
Joint::JointType type
Definition: joint.hpp:229
Frame pose(const double &q) const
Request the 6D-pose between the beginning and the end of the joint at joint position q.
Definition: joint.cpp:76
JointType
Definition: joint.hpp:47
@ TransAxis
Definition: joint.hpp:47
@ TransZ
Definition: joint.hpp:47
@ None
Definition: joint.hpp:47
@ TransY
Definition: joint.hpp:47
@ RotY
Definition: joint.hpp:47
@ RotX
Definition: joint.hpp:47
@ Fixed
Definition: joint.hpp:47
@ TransX
Definition: joint.hpp:47
@ RotAxis
Definition: joint.hpp:47
@ RotZ
Definition: joint.hpp:47
double stiffness
Definition: joint.hpp:234
virtual ~Joint()
Definition: joint.cpp:72
const JointType & getType() const
Request the type of the joint.
Definition: joint.hpp:159
Frame joint_pose
Definition: joint.hpp:238
represents both translational and rotational velocities.
Definition: frames.hpp:720
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:161
Definition: articulatedbodyinertia.cpp:26