KDL  1.4.0
segment.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 
23 #ifndef KDL_SEGMENT_HPP
24 #define KDL_SEGMENT_HPP
25 
26 #include "frames.hpp"
27 #include "rigidbodyinertia.hpp"
28 #include "joint.hpp"
29 #include <vector>
30 
31 namespace KDL {
32 
46  class Segment {
47  friend class Chain;
48  private:
49  std::string name;
53 
54  public:
65  explicit Segment(const std::string& name, const Joint& joint=Joint(Joint::None), const Frame& f_tip=Frame::Identity(),const RigidBodyInertia& I = RigidBodyInertia::Zero());
76  Segment(const Segment& in);
77  Segment& operator=(const Segment& arg);
78 
79  virtual ~Segment();
80 
88  Frame pose(const double& q)const;
100  Twist twist(const double& q,const double& qdot)const;
101 
108  const std::string& getName()const
109  {
110  return name;
111  }
118  const Joint& getJoint()const
119  {
120  return joint;
121  }
129  {
130  return I;
131  }
138  void setInertia(const RigidBodyInertia& Iin)
139  {
140  this->I=Iin;
141  }
142 
150  {
151 
152  return joint.pose(0)*f_tip;
153  }
154 
161  void setFrameToTip(const Frame& f_tip_new);
162  };
163 }//end of namespace KDL
164 
165 #endif
frames.hpp
KDL::Frame::Identity
static Frame Identity()
Definition: frames.inl:695
KDL::Segment::f_tip
Frame f_tip
Definition: segment.hpp:52
KDL::Frame::Inverse
Frame Inverse() const
Gives back inverse transformation of a Frame.
Definition: frames.inl:422
KDL::Segment::getJoint
const Joint & getJoint() const
Request the joint of the segment.
Definition: segment.hpp:118
KDL::Joint::twist
Twist twist(const double &qdot) const
Request the resulting 6D-velocity with a joint velocity qdot.
Definition: joint.cpp:106
KDL::Frame::p
Vector p
origine of the Frame
Definition: frames.hpp:572
KDL::Segment::I
RigidBodyInertia I
Definition: segment.hpp:51
KDL::Segment::setFrameToTip
void setFrameToTip(const Frame &f_tip_new)
Set the pose from the joint end to the tip of the segment.
Definition: segment.cpp:67
KDL::RigidBodyInertia
6D Inertia of a rigid body
Definition: rigidbodyinertia.hpp:37
KDL::Segment::joint
Joint joint
Definition: segment.hpp:50
KDL
Definition: articulatedbodyinertia.cpp:28
KDL::Joint::pose
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
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:720
rigidbodyinertia.hpp
KDL::Segment::pose
Frame pose(const double &q) const
Request the pose of the segment, given the joint position q.
Definition: segment.cpp:57
KDL::Frame
Definition: frames.hpp:570
KDL::Segment::getFrameToTip
Frame getFrameToTip() const
Request the pose from the joint end to the tip of the segment.
Definition: segment.hpp:149
KDL::Segment::setInertia
void setInertia(const RigidBodyInertia &Iin)
Request the inertia of the segment.
Definition: segment.hpp:138
KDL::Segment::twist
Twist twist(const double &q, const double &qdot) const
Request the 6D-velocity of the tip of the segment, given the joint position q and the joint velocity ...
Definition: segment.cpp:62
KDL::Joint::None
@ None
Definition: joint.hpp:47
KDL::RigidBodyInertia::Zero
static RigidBodyInertia Zero()
Creates an inertia with zero mass, and zero RotationalInertia.
Definition: rigidbodyinertia.hpp:49
KDL::Segment
Definition: segment.hpp:46
KDL::Twist::RefPoint
Twist RefPoint(const Vector &v_base_AB) const
Changes the reference point of the twist.
Definition: frames.inl:302
KDL::Frame::M
Rotation M
Orientation of the Frame.
Definition: frames.hpp:573
KDL::Segment::getName
const std::string & getName() const
Request the name of the segment.
Definition: segment.hpp:108
KDL::Segment::~Segment
virtual ~Segment()
Definition: segment.cpp:53
KDL::Segment::operator=
Segment & operator=(const Segment &arg)
Definition: segment.cpp:44
KDL::Joint
Definition: joint.hpp:45
KDL::Segment::name
std::string name
Definition: segment.hpp:49
KDL::Segment::Segment
Segment(const std::string &name, const Joint &joint=Joint(Joint::None), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
Constructor of the segment.
Definition: segment.cpp:24
KDL::Chain
Definition: chain.hpp:35
KDL::Segment::getInertia
const RigidBodyInertia & getInertia() const
Request the inertia of the segment.
Definition: segment.hpp:128
joint.hpp
segment.hpp