Blender V2.61 - r43446
|
00001 00004 // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be> 00005 00006 // Version: 1.0 00007 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> 00008 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> 00009 // URL: http://www.orocos.org/kdl 00010 00011 // This library is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU Lesser General Public 00013 // License as published by the Free Software Foundation; either 00014 // version 2.1 of the License, or (at your option) any later version. 00015 00016 // This library is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 #include "kinfam_io.hpp" 00026 #include "frames_io.hpp" 00027 00028 namespace KDL { 00029 std::ostream& operator <<(std::ostream& os, const Joint& joint) { 00030 return os << joint.getTypeName(); 00031 } 00032 00033 std::istream& operator >>(std::istream& is, Joint& joint) { 00034 return is; 00035 } 00036 00037 std::ostream& operator <<(std::ostream& os, const Segment& segment) { 00038 os << "[" << segment.getJoint() << ",\n" << segment.getFrameToTip() << "]"; 00039 return os; 00040 } 00041 00042 std::istream& operator >>(std::istream& is, Segment& segment) { 00043 return is; 00044 } 00045 00046 std::ostream& operator <<(std::ostream& os, const Chain& chain) { 00047 os << "["; 00048 for (unsigned int i = 0; i < chain.getNrOfSegments(); i++) 00049 os << chain.getSegment(i) << "\n"; 00050 os << "]"; 00051 return os; 00052 } 00053 00054 std::istream& operator >>(std::istream& is, Chain& chain) { 00055 return is; 00056 } 00057 00058 std::ostream& operator <<(std::ostream& os, const Tree& tree) { 00059 SegmentMap::const_iterator root = tree.getSegment("root"); 00060 return os << root; 00061 } 00062 00063 std::ostream& operator <<(std::ostream& os, SegmentMap::const_iterator root) { 00064 //os<<root->first<<": "<<root->second.segment<<"\n"; 00065 os << root->first<<"(q_nr: "<<root->second.q_nr<<")"<<"\n \t"; 00066 for (unsigned int i = 0; i < root->second.children.size(); i++) { 00067 os <<(root->second.children[i])<<"\t"; 00068 } 00069 return os << "\n"; 00070 } 00071 00072 std::istream& operator >>(std::istream& is, Tree& tree) { 00073 return is; 00074 } 00075 00076 std::ostream& operator <<(std::ostream& os, const JntArray& array) { 00077 os << "["; 00078 for (unsigned int i = 0; i < array.rows(); i++) 00079 os << std::setw(KDL_FRAME_WIDTH) << array(i); 00080 os << "]"; 00081 return os; 00082 } 00083 00084 std::istream& operator >>(std::istream& is, JntArray& array) { 00085 return is; 00086 } 00087 00088 std::ostream& operator <<(std::ostream& os, const Jacobian& jac) { 00089 os << "["; 00090 for (unsigned int i = 0; i < jac.rows(); i++) { 00091 for (unsigned int j = 0; j < jac.columns(); j++) 00092 os << std::setw(KDL_FRAME_WIDTH) << jac(i, j); 00093 os << std::endl; 00094 } 00095 os << "]"; 00096 return os; 00097 } 00098 00099 std::istream& operator >>(std::istream& is, Jacobian& jac) { 00100 return is; 00101 } 00102 00103 } 00104