Orocos KDL
segment.hpp
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
31namespace KDL {
32
46 class Segment {
47 friend class Chain;
48 private:
49 std::string name;
50 Joint joint;
52 Frame f_tip;
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);
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 }
112
118 const Joint& getJoint()const
119 {
120 return joint;
121 }
122
129 {
130 return I;
131 }
132
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
171 {
172 return f_tip;
173 }
174 };
175}//end of namespace KDL
176
177#endif
represents a frame transformation in 3D space (rotation + translation)
Definition frames.hpp:572
static Frame Identity()
Definition frames.hpp:701
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition joint.hpp:45
@ Fixed
Definition joint.hpp:47
6D Inertia of a rigid body
Definition rigidbodyinertia.hpp:37
static RigidBodyInertia Zero()
Definition rigidbodyinertia.hpp:49
Segment & operator=(const Segment &arg)
const Joint & getJoint() const
Definition segment.hpp:118
Segment(const Segment &in)
const Frame & getFrameToTipZero() const
Definition segment.hpp:170
friend class Chain
Definition segment.hpp:47
Frame getFrameToTip() const
Definition segment.hpp:149
Segment(const Joint &joint=Joint(Joint::Fixed), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
Twist twist(const double &q, const double &qdot) const
const std::string & getName() const
Definition segment.hpp:108
Segment(const std::string &name, const Joint &joint=Joint(Joint::Fixed), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
void setInertia(const RigidBodyInertia &Iin)
Definition segment.hpp:138
virtual ~Segment()
const RigidBodyInertia & getInertia() const
Definition segment.hpp:128
void setFrameToTip(const Frame &f_tip_new)
Frame pose(const double &q) const
represents both translational and rotational velocities.
Definition frames.hpp:723
Definition articulatedbodyinertia.hpp:32