Blender  V3.3
segment.cpp
Go to the documentation of this file.
1 
4 // Version: 1.0
5 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
6 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
7 // URL: http://www.orocos.org/kdl
8 
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 #include "segment.hpp"
24 
25 namespace KDL {
26 
27  Segment::Segment(const Joint& _joint, const Frame& _f_tip, const Inertia& _M):
28  M(_M),joint(_joint),
29  f_tip(_f_tip)
30  {
31  }
32 
34  M(in.M),joint(in.joint),
35  f_tip(in.f_tip)
36  {
37  }
38 
40  {
41  joint=arg.joint;
42  M=arg.M;
43  f_tip=arg.f_tip;
44  return *this;
45  }
46 
48  {
49  }
50 
51  Frame Segment::pose(const double* q)const
52  {
53  return joint.pose(q)*f_tip;
54  }
55 
56  Twist Segment::twist(const double* q, const double& qdot, int dof)const
57  {
58  return joint.twist(qdot, dof).RefPoint(pose(q).p);
59  }
60 
61  Twist Segment::twist(const Vector& p, const double& qdot, int dof)const
62  {
63  return joint.twist(qdot, dof).RefPoint(p);
64  }
65 
66  Twist Segment::twist(const Frame& f, const double& qdot, int dof)const
67  {
68  return (f.M*joint.twist(qdot, dof)).RefPoint(f.p);
69  }
70 }//end of namespace KDL
71 
represents a frame transformation in 3D space (rotation + translation)
Definition: frames.hpp:526
Rotation M
Orientation of the Frame.
Definition: frames.hpp:529
Vector p
origine of the Frame
Definition: frames.hpp:528
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition: joint.hpp:43
Twist twist(const double &qdot, int dof=0) const
Definition: joint.cpp:104
Frame pose(const double *q) const
Definition: joint.cpp:58
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and an inertia) with...
Definition: segment.hpp:46
virtual ~Segment()
Definition: segment.cpp:47
Segment & operator=(const Segment &arg)
Definition: segment.cpp:39
Frame pose(const double *q) const
Definition: segment.cpp:51
Twist twist(const double *q, const double &qdot, int dof=0) const
Definition: segment.cpp:56
Segment(const Joint &joint=Joint(), const Frame &f_tip=Frame::Identity(), const Inertia &M=Inertia::Zero())
Definition: segment.cpp:27
represents both translational and rotational velocities.
Definition: frames.hpp:679
Twist RefPoint(const Vector &v_base_AB) const
Definition: frames.inl:322
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:143
#define M
Definition: chain.cpp:27