kinfam_io.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "kinfam_io.hpp"
00023 #include "frames_io.hpp"
00024
00025 namespace KDL {
00026 std::ostream& operator <<(std::ostream& os, const Joint& joint) {
00027 return os << joint.getTypeName();
00028 }
00029
00030 std::istream& operator >>(std::istream& is, Joint& joint) {
00031 return is;
00032 }
00033
00034 std::ostream& operator <<(std::ostream& os, const Segment& segment) {
00035 os << "[" << segment.getJoint() << ",\n" << segment.getFrameToTip() << "]";
00036 return os;
00037 }
00038
00039 std::istream& operator >>(std::istream& is, Segment& segment) {
00040 return is;
00041 }
00042
00043 std::ostream& operator <<(std::ostream& os, const Chain& chain) {
00044 os << "[";
00045 for (unsigned int i = 0; i < chain.getNrOfSegments(); i++)
00046 os << chain.getSegment(i) << "\n";
00047 os << "]";
00048 return os;
00049 }
00050
00051 std::istream& operator >>(std::istream& is, Chain& chain) {
00052 return is;
00053 }
00054
00055 std::ostream& operator <<(std::ostream& os, const Tree& tree) {
00056 SegmentMap::const_iterator root = tree.getSegment("root");
00057 return os << root;
00058 }
00059
00060 std::ostream& operator <<(std::ostream& os, SegmentMap::const_iterator root) {
00061
00062 os << root->first<<"(q_nr: "<<root->second.q_nr<<")"<<"\n \t";
00063 for (unsigned int i = 0; i < root->second.children.size(); i++) {
00064 os <<(root->second.children[i])<<"\t";
00065 }
00066 return os << "\n";
00067 }
00068
00069 std::istream& operator >>(std::istream& is, Tree& tree) {
00070 return is;
00071 }
00072
00073 std::ostream& operator <<(std::ostream& os, const JntArray& array) {
00074 os << "[";
00075 for (unsigned int i = 0; i < array.rows(); i++)
00076 os << std::setw(KDL_FRAME_WIDTH) << array(i);
00077 os << "]";
00078 return os;
00079 }
00080
00081 std::istream& operator >>(std::istream& is, JntArray& array) {
00082 return is;
00083 }
00084
00085 std::ostream& operator <<(std::ostream& os, const Jacobian& jac) {
00086 os << "[";
00087 for (unsigned int i = 0; i < jac.rows(); i++) {
00088 for (unsigned int j = 0; j < jac.columns(); j++)
00089 os << std::setw(KDL_FRAME_WIDTH) << jac(i, j);
00090 os << std::endl;
00091 }
00092 os << "]";
00093 return os;
00094 }
00095
00096 std::istream& operator >>(std::istream& is, Jacobian& jac) {
00097 return is;
00098 }
00099 std::ostream& operator <<(std::ostream& os, const JntSpaceInertiaMatrix& jntspaceinertiamatrix) {
00100 os << "[";
00101 for (unsigned int i = 0; i < jntspaceinertiamatrix.rows(); i++) {
00102 for (unsigned int j = 0; j < jntspaceinertiamatrix.columns(); j++)
00103 os << std::setw(KDL_FRAME_WIDTH) << jntspaceinertiamatrix(i, j);
00104 os << std::endl;
00105 }
00106 os << "]";
00107 return os;
00108 }
00109
00110 std::istream& operator >>(std::istream& is, JntSpaceInertiaMatrix& jntspaceinertiamatrix) {
00111 return is;
00112 }
00113 }
00114