icp.h
Go to the documentation of this file.
00001 /*************************************************************************
00002   > File Name: icp.h
00003   > Author: 吴乃亮
00004   > Mail: wunailiang@gmail.com
00005   > Created Time: Wed 21 May 2014 07:00:53 PM CST
00006  ************************************************************************/
00007 #ifndef icp_h
00008 #define icp_h
00009 
00010 #include <iostream>
00011 #include "ros/ros.h"
00012 #include <eigen3/Eigen/Dense>
00013 #include <boost/unordered_map.hpp> //不需要排序的话最好用这个hash_map
00014 #include "unordered_map_voxel.h"
00015 #include "voxel.h"
00016 #include <vector>
00017 #include <pcl/console/parse.h>
00018 #include <pcl/registration/ia_ransac.h>
00019 
00020 typedef boost::unordered_map<unordered_map_voxel,un_key> umap;
00021 
00022 class LS_Param //least_square_param
00023 {
00024     public:
00025         Matrix3d S_merged;
00026         Vector3d u_a;
00027         Vector3d u_b;
00028         Vector3d v1;
00029         ArrayXd CT;
00030         double lamada1;
00031 };
00032 
00033 class Icp
00034 {
00035     public:
00036         //Icp(){}
00037         Icp(umap &m1, umap &m2,pcl::PointCloud<pcl::PointXYZ> &cloud,double voxel_size);
00038         ~Icp(){RT.close();}
00039 
00040         void least_Square();//最小二乘
00041 
00042         bool voxel_Merge(unordered_map_voxel &v1 , unordered_map_voxel &v2);//合并匹配对,计算出CT行向量
00043 
00044         bool linear_System();//建立Ax=b的线性模型
00045 
00046         bool correction();//校正
00047 
00048         bool is_Fit(double angle_x,double angle_y,double angle_z,Vector3d shift_t);
00049 
00050         bool end_of_iteration(const vector<bool>& result);
00051 
00052         Eigen::Matrix4f icpFit();
00053 
00054     private:
00055         Matrix3d R;
00056         Vector3d t;
00057 
00058         umap& m_1;
00059         umap& m_2;
00060 
00061         vector<LS_Param> mat_param;
00062         LS_Param temp_ls;
00063         umap m_1_copy;
00064         pcl::PointCloud<pcl::PointXYZ> cloud_source;
00065 
00066         bool first_iter;
00067         bool _is_Fit;
00068 
00069         double voxel_size,jd_x, jd_y, jd_z;
00070 
00071         std::ofstream RT;
00072 };
00073 
00074 #endif


dlut_hash_icp
Author(s): Zhuang Yan , Yan Fei, Wu Nai Liang
autogenerated on Thu Jun 6 2019 18:56:21