Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <coverage_3d_tools/conversions.h>
00010
00011 Eigen::VectorXf StdVector2Eigen(const std::vector<double>& v) {
00012
00013 Eigen::VectorXf res = Eigen::VectorXf::Zero(v.size());
00014 for (unsigned int i = 0; i < v.size(); ++i) {
00015 res(i) = v[i];
00016 }
00017 return res;
00018 }
00019
00020 std::vector<double> VectorEigen2Std(const Eigen::VectorXf& v) {
00021
00022 std::vector<double> res;
00023 for (unsigned int i = 0; i < v.rows(); ++i) {
00024 res.push_back(v(i));
00025 }
00026 return res;
00027 }
00028
00029 pcl::PointXYZ VectorEigen2PointXYZ(Eigen::Vector3f v) {
00030 pcl::PointXYZ p;
00031 p.x = v[0];
00032 p.y = v[1];
00033 p.z = v[2];
00034 return p;
00035 }
00036
00037 Eigen::Vector3f PoseTF2EigenVector3(tf::Pose pose) {
00038 Eigen::Vector3f v;
00039 v[0] = pose.getOrigin()[0];
00040 v[1] = pose.getOrigin()[1];
00041 v[2] = pose.getOrigin()[2];
00042 return v;
00043 }