#ifndef FAST_GICP_FAST_VGICP_CUDA_CORE_CUH #define FAST_GICP_FAST_VGICP_CUDA_CORE_CUH #include #include #include #include #include namespace thrust { template class pair; template class device_allocator; template class device_vector; } // namespace thrust namespace fast_gicp { namespace cuda { class GaussianVoxelMap; class FastVGICPCudaCore { public: using Points = thrust::device_vector>; using Indices = thrust::device_vector>; using Matrices = thrust::device_vector>; using Correspondences = thrust::device_vector, thrust::device_allocator>>; using VoxelCoordinates = thrust::device_vector>; EIGEN_MAKE_ALIGNED_OPERATOR_NEW FastVGICPCudaCore(); ~FastVGICPCudaCore(); void set_resolution(double resolution); void set_kernel_params(double kernel_width, double kernel_max_dist); void set_neighbor_search_method(fast_gicp::NeighborSearchMethod method, double radius); void swap_source_and_target(); void set_source_cloud(const std::vector>& cloud); void set_target_cloud(const std::vector>& cloud); void set_source_neighbors(int k, const std::vector& neighbors); void set_target_neighbors(int k, const std::vector& neighbors); void find_source_neighbors(int k); void find_target_neighbors(int k); void calculate_source_covariances(RegularizationMethod method); void calculate_target_covariances(RegularizationMethod method); void calculate_source_covariances_rbf(RegularizationMethod method); void calculate_target_covariances_rbf(RegularizationMethod method); void get_source_covariances(std::vector>& covs) const; void get_target_covariances(std::vector>& covs) const; void get_voxel_num_points(std::vector& num_points) const; void get_voxel_means(std::vector>& means) const; void get_voxel_covs(std::vector>& covs) const; void get_voxel_correspondences(std::vector>& correspondences) const; void create_target_voxelmap(); void update_correspondences(const Eigen::Isometry3d& trans); double compute_error(const Eigen::Isometry3d& trans, Eigen::Matrix* H, Eigen::Matrix* b) const; public: double resolution; double kernel_width; double kernel_max_dist; std::unique_ptr offsets; std::unique_ptr source_points; std::unique_ptr target_points; std::unique_ptr source_neighbors; std::unique_ptr target_neighbors; std::unique_ptr source_covariances; std::unique_ptr target_covariances; std::unique_ptr voxelmap; Eigen::Isometry3f linearized_x; std::unique_ptr voxel_correspondences; }; } // namespace cuda } // namespace fast_gicp #endif