python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

writing an extension base on python-pcl

Open MichaleWong opened this issue 5 years ago • 0 comments

I wrote an extension (cythontest.pyx) of regiongrowingrgb base on python-pcl ,how should I compile them, only compiled cythontest.pyx, or using your setup.py and compiled with _pcl.pyx?

Your Environment

  • Operating System and version:
  • Compiler:
  • PCL Version:
  • Cython Version:

Context

because after comiling by my setup.py, in python shell ,I got error:TypeError: Argument 'cloud' has incorrect type (expected pcl._pcl.PointCloud_PointXYZRGB, got pcl._pcl.PointCloud_PointXYZRGB) cythontest.pxd file cdef extern from "helloworld.h": void RegionGrowingRGB(cpp.PointCloud_PointXYZRGB_Ptr_t cloud, vector[cpp.PointIndices]& clusters, float dist_th, float p_clr_th, float r_clr_th, int min_size) pyx fiile def region_growing_rgb(PointCloud_PointXYZRGB cloud,dist_th, p_clr_th,r_clr_th,min_size): ...... cythontest.RegionGrowingRGB(cloud.thisptr_shared,clusters,dist_th, p_clr_th, r_clr_th, min_size) setup.py from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize ''' setup( ext_modules = cythonize("cythontest.pyx") ) ''' setup(ext_modules=cythonize([Extension( "cythontest", ["cythontest.pyx"], language='c++', libraries=['pcl_kdtree','pcl_io','pcl_common','pcl_filters','pcl_segmentation',\ 'pcl_sample_consensus','pcl_io_ply','pcl_search','pcl_octree','pcl_ml','pcl_features',\ 'flann_cpp','boost_system','boost_filesystem','boost_thread','boost_iostreams',\ 'bz2']) ]))

Expected Behavior

Current Behavior

Code to Reproduce

Possible Solution

MichaleWong avatar Apr 30 '20 07:04 MichaleWong