Blender V4.3
kinfam_io.cpp
Go to the documentation of this file.
1
4// Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
5
6// Version: 1.0
7// Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
8// Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
9// URL: http://www.orocos.org/kdl
10
11// This library is free software; you can redistribute it and/or
12// modify it under the terms of the GNU Lesser General Public
13// License as published by the Free Software Foundation; either
14// version 2.1 of the License, or (at your option) any later version.
15
16// This library is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19// Lesser General Public License for more details.
20
21// You should have received a copy of the GNU Lesser General Public
22// License along with this library; if not, write to the Free Software
23// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25#include "kinfam_io.hpp"
26#include "frames_io.hpp"
27
28namespace KDL {
29std::ostream& operator <<(std::ostream& os, const Joint& joint) {
30 return os << joint.getTypeName();
31}
32
33std::istream& operator >>(std::istream& is, Joint& joint) {
34 return is;
35}
36
37std::ostream& operator <<(std::ostream& os, const Segment& segment) {
38 os << "[" << segment.getJoint() << ",\n" << segment.getFrameToTip() << "]";
39 return os;
40}
41
42std::istream& operator >>(std::istream& is, Segment& segment) {
43 return is;
44}
45
46std::ostream& operator <<(std::ostream& os, const Chain& chain) {
47 os << "[";
48 for (unsigned int i = 0; i < chain.getNrOfSegments(); i++)
49 os << chain.getSegment(i) << "\n";
50 os << "]";
51 return os;
52}
53
54std::istream& operator >>(std::istream& is, Chain& chain) {
55 return is;
56}
57
58std::ostream& operator <<(std::ostream& os, const Tree& tree) {
59 SegmentMap::const_iterator root = tree.getSegment("root");
60 return os << root;
61}
62
63std::ostream& operator <<(std::ostream& os, SegmentMap::const_iterator root) {
64 //os<<root->first<<": "<<root->second.segment<<"\n";
65 os << root->first<<"(q_nr: "<<root->second.q_nr<<")"<<"\n \t";
66 for (unsigned int i = 0; i < root->second.children.size(); i++) {
67 os <<(root->second.children[i])<<"\t";
68 }
69 return os << "\n";
70}
71
72std::istream& operator >>(std::istream& is, Tree& tree) {
73 return is;
74}
75
76std::ostream& operator <<(std::ostream& os, const JntArray& array) {
77 os << "[";
78 for (unsigned int i = 0; i < array.rows(); i++)
79 os << std::setw(KDL_FRAME_WIDTH) << array[i];
80 os << "]";
81 return os;
82}
83
84std::istream& operator >>(std::istream& is, JntArray& array) {
85 return is;
86}
87
88std::ostream& operator <<(std::ostream& os, const Jacobian& jac) {
89 os << "[";
90 for (unsigned int i = 0; i < jac.rows(); i++) {
91 for (unsigned int j = 0; j < jac.columns(); j++)
92 os << std::setw(KDL_FRAME_WIDTH) << jac(i, j);
93 os << std::endl;
94 }
95 os << "]";
96 return os;
97}
98
99std::istream& operator >>(std::istream& is, Jacobian& jac) {
100 return is;
101}
102
103}
104
This class encapsulates a serial kinematic interconnection structure. It is build out of segments.
Definition chain.hpp:36
const Segment & getSegment(unsigned int nr) const
Definition chain.cpp:68
unsigned int getNrOfSegments() const
Definition chain.hpp:78
unsigned int columns() const
Definition jacobian.cpp:76
unsigned int rows() const
Definition jacobian.cpp:71
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
Definition joint.hpp:43
const std::string getTypeName() const
Definition joint.hpp:98
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and an inertia) with ...
Definition segment.hpp:46
This class encapsulates a tree kinematic interconnection structure. It is build out of segments.
Definition tree.hpp:68
KDTree_3d * tree
#define KDL_FRAME_WIDTH
Definition kdl-config.h:30
Definition chain.cpp:27
std::ostream & operator<<(std::ostream &os, const Vector &v)
Definition frames_io.cpp:45
std::istream & operator>>(std::istream &is, Vector &v)