ndt_map_builder.h
Go to the documentation of this file.
00001 #include <ndt_registration/ndt_matcher_p2d.h>
00002 #include <ndt_registration/ndt_matcher_d2d.h>
00003 #include <ndt_map/ndt_histogram.h>
00004 
00005 namespace lslgeneric
00006 {
00007 
00008   class MapVertex{
00009   public:
00010     Eigen::Transform<double,3,Eigen::Affine,Eigen::ColMajor> pose;
00011     pcl::PointCloud<pcl::PointXYZ> scan;
00012     int id;
00013     NDTHistogram hist;
00014     double timeRegistration;
00015   public:
00016     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00017       };
00018 
00019   class MapEdge{
00020   public:
00021     Eigen::Transform<double,3,Eigen::Affine,Eigen::ColMajor> relative_pose;
00022     Eigen::Matrix<double,6,6> covariance;
00023     int idFirst, idSecond;
00024   public:
00025     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00026       };
00027 
00028 
00029   class NDTMapBuilder{
00030   public:
00031   NDTMapBuilder(double res, bool _doHistogram = false):tr(res){
00032       isP2F = false;
00033       isF2F=false;
00034       doHistogram = _doHistogram;
00035     }
00036     /* bool setICP(){ */
00037     /*       isP2F = false; */
00038     /*       isF2F=false; */
00039     /*       return true; */
00040     /*   } */
00041     bool setMatcherP2F(NDTMatcherP2D *_matcherP2F){
00042       matcherP2F  = _matcherP2F;
00043       isP2F = true;
00044       isF2F=false;
00045       return true;
00046     }
00047 
00048     bool setMatcherF2F(NDTMatcherD2D *_matcherF2F){
00049       matcherF2F  = _matcherF2F;
00050       isP2F = false;
00051       isF2F=true;
00052       return true;
00053     }
00054 
00055     bool addScan(pcl::PointCloud<pcl::PointXYZ> scan, int id=-1);
00056     void saveG2OlogFile(const char* fname);
00057     void saveDatlogFile(const char* fname);
00058     void printNodePositions();
00059 
00060     lslgeneric::LazyGrid tr;
00061 
00062   private:
00063     NDTMatcherP2D *matcherP2F;
00064     NDTMatcherD2D *matcherF2F;
00065     bool isP2F, isF2F, doHistogram;
00066     double resolution;
00067     std::vector<MapVertex> vertices;
00068     std::vector<MapEdge> edges;
00069 
00070 
00071     /* bool matchICP(pcl::PointCloud<pcl::PointXYZ> &target,  pcl::PointCloud<pcl::PointXYZ> &source, */
00072     /*               Eigen::Transform<double,3,Eigen::Affine,Eigen::ColMajor> &Tout, double &finalscore); */
00073   };
00074 }
00075 
00076 


ndt_map_builder
Author(s): Todor Stoyanov
autogenerated on Wed Aug 26 2015 15:25:12