00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 #ifndef JSPACE_WRAP_EIGEN_HPP
00027 #define JSPACE_WRAP_EIGEN_HPP
00028
00029 #include <Eigen/Geometry>
00030 #include <vector>
00031
00032 namespace jspace {
00033
00034 typedef Eigen::Transform3d Transform;
00035 typedef Eigen::Translation3d Translation;
00036 typedef Eigen::Quaternion<double> Quaternion;
00037 typedef Eigen::VectorXd Vector;
00038 typedef Eigen::MatrixXd Matrix;
00039
00040
00041
00042
00043
00044
00045 void convert(jspace::Vector const & from, std::vector<double> & to);
00046 void convert(std::vector<double> const & from, jspace::Vector & to);
00047 void convert(double const * from, size_t length, jspace::Vector & to);
00048
00049
00050 bool compare(jspace::Matrix const & lhs, jspace::Matrix const & rhs, double precision);
00051 bool compare(jspace::Quaternion const & lhs, jspace::Quaternion const & rhs, double precision);
00052
00053 std::string pretty_string(double vv);
00054 std::string pretty_string(jspace::Vector const & vv);
00055 std::string pretty_string(jspace::Quaternion const & qq);
00056 std::string pretty_string(jspace::Matrix const & mm, std::string const & prefix);
00057
00058 void pretty_print(jspace::Vector const & vv, std::ostream & os,
00059 std::string const & title, std::string const & prefix, bool nonl = false);
00060
00061 inline void pretty_print(Eigen::Vector3d const & vv, std::ostream & os,
00062 std::string const & title, std::string const & prefix, bool nonl = false)
00063 {
00064 pretty_print(static_cast<jspace::Vector const &>(vv), os, title, prefix, nonl);
00065 }
00066
00067 void pretty_print(jspace::Quaternion const & qq, std::ostream & os,
00068 std::string const & title, std::string const & prefix, bool nonl = false);
00069
00070 void pretty_print(jspace::Matrix const & mm, std::ostream & os,
00071 std::string const & title, std::string const & prefix,
00072 bool vecmode = false, bool nonl = false);
00073
00074 }
00075
00076 #endif // JSPACE_WRAP_EIGEN_HPP