Problems with using custom point type in Point Cloud Library (PCL)t [closed]

asked 2020-01-09 00:01:11 -0500

ivanll gravatar image

updated 2020-01-09 02:01:47 -0500

gvdhoorn gravatar image

I came across a problem when trying to register two point clouds using PCL. Instead of using the provided PointT, I used custom point type and followed the tutorial(http://www.pointclouds.org/d.... However, when I complied the codes in VS2019, it failed. I also tried this post ( https://stackoverflow.com/questions/3...). It didn't work neither.

Here is the defination of the point

#ifndef PCL_NO_PRECOMPILE
#define PCL_NO_PRECOMPILE
#endif
#include <iostream>
#include <pcl/pcl_macros.h>
#include <pcl/point_types.h> 
#include <pcl/impl/point_types.hpp>
#include <pcl/impl/instantiate.hpp>
#include <pcl/point_cloud.h>
#include <pcl/impl/point_types.hpp>
#include <pcl/common/transforms.h>
#include <pcl/common/impl/transforms.hpp>
#include <pcl/registration/icp.h>
#include <pcl/registration/impl/icp.hpp>
struct dPointXYZ {
        double x;
        double y;
        double z;
};
POINT_CLOUD_REGISTER_POINT_STRUCT(dPointXYZ,
(double, x, x)
(double, y, y)
(double, z, z)
)

This is how I use the custom point type.

void voxelFilteringPoints(pcl::PointCloud<pcl::dPointXYZ>::Ptr& ProjPoint, pcl::PointCloud<pcl::dPointXYZ>::Ptr& filteredPoints, float dGridSize)
{

    pcl::VoxelGrid<pcl::dPointXYZ> ApproximateVoxelGrid;
    ApproximateVoxelGrid.setLeafSize(dGridSize, dGridSize, dGridSize);
    ApproximateVoxelGrid.setInputCloud(ProjPoint);
    ApproximateVoxelGrid.filter(*filteredPoints);
    //std::cout<<"Filtered points size: "<<*filteredPoints<<std::endl;
}

This is the compiling result:

Error   C2953   'pcl::detail::Transformer': class template has already been defined ConsoleApplication1 C:\Program Files\PCL_1.9.1\include\pcl-1.9\pcl\common\impl\transforms.hpp   89  

Error   C2995   'void pcl::transformPointCloud(const pcl::PointCloud<PointT> &,pcl::PointCloud<PointT> &,const Eigen::Transform<Scalar,3,2,0> &,bool)': function template has already been defined  ConsoleApplication1 C:\Program Files\PCL_1.9.1\include\pcl-1.9\pcl\common\impl\transforms.hpp   215     

Error   C2995   'void pcl::transformPointCloud(const pcl::PointCloud<PointT> &,const std::vector<int,std::allocator<_Ty>> &,pcl::PointCloud<PointT> &,const Eigen::Transform<Scalar,3,2,0> &,bool)': function template has already been defined
 ConsoleApplication1    C:\Program Files\PCL_1.9.1\include\pcl-1.9\pcl\common\impl\transforms.hpp   259

I tried to change the definition of the functions in transforms.hpp and transforms.h, it didn't help. Do you have any ideas how to solve the problem?

edit retag flag offensive reopen merge delete

Closed for the following reason PCL Question: The PCL community prefers to answer questions at http://www.pcl-users.org/ by gvdhoorn
close date 2020-01-09 02:01:58.847159

Comments

There is no mention or use of ROS anywhere in the code or the problem statement. We do use PCL in the ROS community, but this forum is not where PCL developers/maintainers come to support their users.

It would be better to post on the proper fora.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-09 02:03:54 -0500 )edit