kinfam_io.cpp
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 #include "kinfam_io.hpp"
23 #include "frames_io.hpp"
24 
25 namespace KDL {
26 std::ostream& operator <<(std::ostream& os, const Joint& joint) {
27  return os << joint.getName()<<":["<<joint.getTypeName()
28  <<", axis: "<<joint.JointAxis() << ", origin"<<joint.JointOrigin()<<"]";
29 }
30 
31 std::istream& operator >>(std::istream& is, Joint& joint) {
32  return is;
33 }
34 
35 std::ostream& operator <<(std::ostream& os, const Segment& segment) {
36  os << segment.getName()<<":[" << segment.getJoint() << ",\n tip: \n" << segment.getFrameToTip() << "]";
37  return os;
38 }
39 
40 std::istream& operator >>(std::istream& is, Segment& segment) {
41  return is;
42 }
43 
44 std::ostream& operator <<(std::ostream& os, const Chain& chain) {
45  os << "[";
46  for (unsigned int i = 0; i < chain.getNrOfSegments(); i++)
47  os << chain.getSegment(i) << "\n";
48  os << "]";
49  return os;
50 }
51 
52 std::istream& operator >>(std::istream& is, Chain& chain) {
53  return is;
54 }
55 
56 std::ostream& operator <<(std::ostream& os, const Tree& tree) {
57  SegmentMap::const_iterator root = tree.getRootSegment();
58  return os << root;
59 }
60 
61 std::ostream& operator <<(std::ostream& os, SegmentMap::const_iterator root) {
62  //os<<root->first<<": "<<root->second.segment<<"\n";
63  os << root->first<<"(q_nr: "<< GetTreeElementQNr(root->second) << ")" << "\n \t";
64  for (unsigned int i = 0; i < GetTreeElementChildren(root->second).size(); i++) {
65  os << ( GetTreeElementChildren(root->second)[i] ) << "\t";
66  }
67  return os << "\n";
68 }
69 
70 std::istream& operator >>(std::istream& is, Tree& tree) {
71  return is;
72 }
73 
74 std::ostream& operator <<(std::ostream& os, const JntArray& array) {
75  os << "[";
76  for (unsigned int i = 0; i < array.rows(); i++)
77  os << std::setw(KDL_FRAME_WIDTH) << array(i);
78  os << "]";
79  return os;
80 }
81 
82 std::istream& operator >>(std::istream& is, JntArray& array) {
83  return is;
84 }
85 
86 std::ostream& operator <<(std::ostream& os, const Jacobian& jac) {
87  os << "[";
88  for (unsigned int i = 0; i < jac.rows(); i++) {
89  for (unsigned int j = 0; j < jac.columns(); j++)
90  os << std::setw(KDL_FRAME_WIDTH) << jac(i, j);
91  os << std::endl;
92  }
93  os << "]";
94  return os;
95 }
96 
97 std::istream& operator >>(std::istream& is, Jacobian& jac) {
98  return is;
99 }
100 std::ostream& operator <<(std::ostream& os, const JntSpaceInertiaMatrix& jntspaceinertiamatrix) {
101  os << "[";
102  for (unsigned int i = 0; i < jntspaceinertiamatrix.rows(); i++) {
103  for (unsigned int j = 0; j < jntspaceinertiamatrix.columns(); j++)
104  os << std::setw(KDL_FRAME_WIDTH) << jntspaceinertiamatrix(i, j);
105  os << std::endl;
106  }
107  os << "]";
108  return os;
109 }
110 
111 std::istream& operator >>(std::istream& is, JntSpaceInertiaMatrix& jntspaceinertiamatrix) {
112  return is;
113 }
114 }
115 
const Segment & getSegment(unsigned int nr) const
Definition: chain.cpp:68
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body...
Definition: segment.hpp:46
unsigned int rows() const
Definition: jntarray.cpp:72
#define GetTreeElementQNr(tree_element)
Definition: tree.hpp:61
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
Definition: chain.hpp:35
std::istream & operator>>(std::istream &is, Vector &v)
Definition: frames_io.cpp:129
unsigned int getNrOfSegments() const
Definition: chain.hpp:76
This class represents an fixed size array containing joint values of a KDL::Chain.
Definition: jntarray.hpp:69
Frame getFrameToTip() const
Definition: segment.hpp:149
#define KDL_FRAME_WIDTH
Definition: kdl-config.h:27
std::ostream & operator<<(std::ostream &os, const VectorAcc &r)
Definition: frameacc_io.hpp:32
#define GetTreeElementChildren(tree_element)
Definition: tree.hpp:59
unsigned int columns() const
Definition: jacobian.cpp:75
Vector JointOrigin() const
Definition: joint.cpp:157
const std::string & getName() const
Definition: joint.hpp:150
const std::string & getName() const
Definition: segment.hpp:108
const Joint & getJoint() const
Definition: segment.hpp:118
SegmentMap::const_iterator getRootSegment() const
Definition: tree.hpp:186
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition: joint.hpp:45
const std::string getTypeName() const
Definition: joint.hpp:169
Vector JointAxis() const
Definition: joint.cpp:131
This class encapsulates a tree kinematic interconnection structure. It is built out of segments...
Definition: tree.hpp:99
unsigned int rows() const
Definition: jacobian.cpp:70


orocos_kdl
Author(s):
autogenerated on Sat Jun 15 2019 19:07:36