#ifndef FAST_GICP_FAST_VGICP_HPP #define FAST_GICP_FAST_VGICP_HPP #include #include #include #include #include #include #include #include #include #include namespace fast_gicp { /** * @brief Fast Voxelized GICP algorithm boosted with OpenMP */ template class FastVGICP : public FastGICP { public: using Scalar = float; using Matrix4 = typename pcl::Registration::Matrix4; using PointCloudSource = typename pcl::Registration::PointCloudSource; using PointCloudSourcePtr = typename PointCloudSource::Ptr; using PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr; using PointCloudTarget = typename pcl::Registration::PointCloudTarget; using PointCloudTargetPtr = typename PointCloudTarget::Ptr; using PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr; protected: using pcl::Registration::input_; using pcl::Registration::target_; using FastGICP::num_threads_; using FastGICP::source_kdtree_; using FastGICP::target_kdtree_; using FastGICP::source_covs_; using FastGICP::target_covs_; public: FastVGICP(); virtual ~FastVGICP() override; void setResolution(double resolution); void setVoxelAccumulationMode(VoxelAccumulationMode mode); void setNeighborSearchMethod(NeighborSearchMethod method); virtual void swapSourceAndTarget() override; virtual void setInputTarget(const PointCloudTargetConstPtr& cloud) override; protected: virtual void computeTransformation(PointCloudSource& output, const Matrix4& guess) override; virtual void update_correspondences(const Eigen::Isometry3d& trans) override; virtual double linearize(const Eigen::Isometry3d& trans, Eigen::Matrix* H = nullptr, Eigen::Matrix* b = nullptr) override; virtual double compute_error(const Eigen::Isometry3d& trans) override; protected: double voxel_resolution_; NeighborSearchMethod search_method_; VoxelAccumulationMode voxel_mode_; std::unique_ptr> voxelmap_; std::vector> voxel_correspondences_; std::vector> voxel_mahalanobis_; }; } // namespace fast_gicp #endif