segment.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 
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::Fixed), const Frame& f_tip=Frame::Identity(),const RigidBodyInertia& I = RigidBodyInertia::Zero());
75  explicit Segment(const Joint& joint=Joint(Joint::Fixed), 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 
170  const Frame& getFrameToTipZero() const
171  {
172  return f_tip;
173  }
174  };
175 }//end of namespace KDL
176 
177 #endif
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
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
Definition: chain.hpp:35
const RigidBodyInertia & getInertia() const
Definition: segment.hpp:128
const Frame & getFrameToTipZero() const
Definition: segment.hpp:170
6D Inertia of a rigid body
Frame getFrameToTip() const
Definition: segment.hpp:149
static Frame Identity()
Definition: frames.hpp:701
void setInertia(const RigidBodyInertia &Iin)
Definition: segment.hpp:138
const Joint & getJoint() const
Definition: segment.hpp:118
represents both translational and rotational velocities.
Definition: frames.hpp:723
void setFrameToTip(const Frame &f_tip_new)
Definition: segment.cpp:67
Frame pose(const double &q) const
Definition: segment.cpp:57
std::string name
Definition: segment.hpp:49
static RigidBodyInertia Zero()
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
const std::string & getName() const
Definition: segment.hpp:108
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
Frame pose(const double &q) const
Definition: joint.cpp:68


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