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


orocos_kdl
Author(s):
autogenerated on Thu Apr 13 2023 02:19:14