KDL 1.5.1
Loading...
Searching...
No Matches
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
31namespace 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());
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 }
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
Definition: chain.hpp:35
Definition: frames.hpp:570
static Frame Identity()
Definition: frames.inl:700
Definition: joint.hpp:45
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
@ Fixed
Definition: joint.hpp:47
6D Inertia of a rigid body
Definition: rigidbodyinertia.hpp:37
static RigidBodyInertia Zero()
Creates an inertia with zero mass, and zero RotationalInertia.
Definition: rigidbodyinertia.hpp:49
Definition: segment.hpp:46
virtual ~Segment()
Definition: segment.cpp:53
Segment & operator=(const Segment &arg)
Definition: segment.cpp:44
const Joint & getJoint() const
Request the joint of the segment.
Definition: segment.hpp:118
RigidBodyInertia I
Definition: segment.hpp:51
Frame getFrameToTip() const
Request the pose from the joint end to the tip of the segment.
Definition: segment.hpp:149
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
Frame f_tip
Definition: segment.hpp:52
const std::string & getName() const
Request the name of the segment.
Definition: segment.hpp:108
std::string name
Definition: segment.hpp:49
void setInertia(const RigidBodyInertia &Iin)
Request the inertia of the segment.
Definition: segment.hpp:138
const RigidBodyInertia & getInertia() const
Request the inertia of the segment.
Definition: segment.hpp:128
Joint joint
Definition: segment.hpp:50
void setFrameToTip(const Frame &f_tip_new)
Set the pose from the joint end to the tip of the segment.
Definition: segment.cpp:67
Frame pose(const double &q) const
Request the pose of the segment, given the joint position q.
Definition: segment.cpp:57
represents both translational and rotational velocities.
Definition: frames.hpp:720
Definition: articulatedbodyinertia.cpp:26