大家!我正在尝试PCL,尤其是其GPU的匹配多维数据集算法的实现。我在Ubuntu 18.04下使用PCL 1.9.1。
但是,当我尝试使用其名为kinfuLS的GPU软件包从TSDF卷生成网格时,遇到了以下所列问题。你能帮我吗?非常感谢!
有问题的代码是:
void RestoreCloudFromTSDF(float* tsdf)
{
// create the cloud first
pcl::PointCloud<pcl::PointXYZRGBA > tsdfCloud ;
float* pTSDF = tsdf;
for (int x = 0; x < m_iBoxWidth; x++)
{
for (int y = 0; y < m_iBoxHight; y++)
{
for (int z = 0; z < m_iBoxDepth; z++)
{
PointT point;
point.x = *pTSDF;
point.y = *(pTSDF+1);
point.z = *(pTSDF+2);
point.rgb = * (pTSDF+3);
pTSDF += 4;
tsdfCloud.push_back(point);
}
}
}
// running matching cubes
pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA > mc(m_iBoxWidth, m_iBoxHight, m_iBoxDepth, m_fVoxelSize);
pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::MeshPtr modelMesh=mc.getMeshFromTSDFCloud(tsdfCloud);
}
最后两行的错误: 1。
warning: instantiation of function
'pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::StandaloneMarchingCubes' required here, but no definition is available
standalone_marching_cubes.h:86:7: note: forward declaration of template entity is here
cloudregister.cpp:205:68: note: add an explicit instantiation declaration to suppress this warning if 'pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::StandaloneMarchingCubes' is explicitly instantiated in another translation unit
2. warning: instantiation of function 'pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::getMeshFromTSDFCloud' required here, but no definition is available
standalone_marching_cubes.h:97:7: note: forward declaration of template entity is here
cloudregister.cpp:206:89: note: add an explicit instantiation declaration to suppress this warning if 'pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::getMeshFromTSDFCloud' is explicitly instantiated in another translation unit
3. error: undefined reference to `pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::StandaloneMarchingCubes(int, int, int, float)'
4. error: undefined reference to `pcl::gpu::kinfuLS::StandaloneMarchingCubes<pcl::PointXYZRGBA>::getMeshFromTSDFCloud(pcl::PointCloud<pcl::PointXYZRGBA> const&)'
再次感谢!