Problems with python3-pcl

Hello everyone,
I am working on ros2 galactic on ubuntu 20.04. I have installed: perception-pcl, vision_opencv and pcl with pip install pcl.
I am trying to use the pcl library to use a surface detection script in python. Unfortunately the scripit does not work because in the pcl there in not the PointCloud class.
I am able to install with pip install pcl but the class installed are only:
import pcl
print(dir(pcl)
builtins_', ‘cached’, ‘doc’, ‘file’, ‘loader’, ‘name’, ‘package’, ‘path’, ‘spec’, 'encode’, '

instead it would be

import pcl
print(dir(pcl))
[‘ApproximateVoxelGrid’, ‘ApproximateVoxelGrid_PointXYZI’, ‘ApproximateVoxelGrid_PointXYZRGB’, ‘ApproximateVoxelGrid_PointXYZRGBA’, ‘ConcaveHull’, ‘ConcaveHull_PointXYZI’, ‘ConcaveHull_PointXYZRGB’, ‘ConcaveHull_PointXYZRGBA’, ‘ConditionAnd’, ‘ConditionalRemoval’, ‘CropBox’, ‘CropHull’, ‘CythonCompareOp_Type’, ‘CythonCoordinateFrame_Type’, ‘EuclideanClusterExtraction’, ‘GeneralizedIterativeClosestPoint’, ‘HarrisKeypoint3D’, ‘IntegralImageNormalEstimation’, ‘IterativeClosestPoint’, ‘IterativeClosestPointNonLinear’, ‘KdTree’, ‘KdTreeFLANN’, ‘KdTreeFLANN_PointXYZI’, ‘KdTreeFLANN_PointXYZRGB’, ‘KdTreeFLANN_PointXYZRGBA’, ‘MomentOfInertiaEstimation’, ‘MovingLeastSquares’, ‘MovingLeastSquares_PointXYZRGB’, ‘MovingLeastSquares_PointXYZRGBA’, ‘NormalDistributionsTransform’, ‘NormalEstimation’, ‘OctreePointCloud’, ‘OctreePointCloud2Buf’, ‘OctreePointCloud2Buf_PointXYZI’, ‘OctreePointCloud2Buf_PointXYZRGB’, ‘OctreePointCloud2Buf_PointXYZRGBA’, ‘OctreePointCloudChangeDetector’, ‘OctreePointCloudChangeDetector_PointXYZI’, ‘OctreePointCloudChangeDetector_PointXYZRGB’, ‘OctreePointCloudChangeDetector_PointXYZRGBA’, ‘OctreePointCloudSearch’, ‘OctreePointCloudSearch_PointXYZI’, ‘OctreePointCloudSearch_PointXYZRGB’, ‘OctreePointCloudSearch_PointXYZRGBA’, ‘OctreePointCloud_PointXYZI’, ‘OctreePointCloud_PointXYZRGB’, ‘OctreePointCloud_PointXYZRGBA’, ‘PassThroughFilter’, ‘PassThroughFilter_PointXYZI’, ‘PassThroughFilter_PointXYZRGB’, ‘PassThroughFilter_PointXYZRGBA’, ‘PointCloud’, ‘PointCloud_Normal’, ‘PointCloud_PointNormal’, ‘PointCloud_PointWithViewpoint’, ‘PointCloud_PointXYZI’, ‘PointCloud_PointXYZRGB’, ‘PointCloud_PointXYZRGBA’, ‘ProjectInliers’, ‘RadiusOutlierRemoval’, ‘RandomSampleConsensus’, ‘RangeImages’, ‘SACMODEL_CIRCLE2D’, ‘SACMODEL_CIRCLE3D’, ‘SACMODEL_CONE’, ‘SACMODEL_CYLINDER’, ‘SACMODEL_LINE’, ‘SACMODEL_NORMAL_PARALLEL_PLANE’, ‘SACMODEL_NORMAL_PLANE’, ‘SACMODEL_NORMAL_SPHERE’, ‘SACMODEL_PARALLEL_LINE’, ‘SACMODEL_PARALLEL_LINES’, ‘SACMODEL_PARALLEL_PLANE’, ‘SACMODEL_PERPENDICULAR_PLANE’, ‘SACMODEL_PLANE’, ‘SACMODEL_REGISTRATION’, ‘SACMODEL_SPHERE’, ‘SACMODEL_STICK’, ‘SACMODEL_TORUS’, ‘SAC_LMEDS’, ‘SAC_MLESAC’, ‘SAC_MSAC’, ‘SAC_PROSAC’, ‘SAC_RANSAC’, ‘SAC_RMSAC’, ‘SAC_RRANSAC’, ‘SampleConsensusModel’, ‘SampleConsensusModelCylinder’, ‘SampleConsensusModelLine’, ‘SampleConsensusModelPlane’, ‘SampleConsensusModelRegistration’, ‘SampleConsensusModelSphere’, ‘SampleConsensusModelStick’, ‘Segmentation’, ‘SegmentationNormal’, ‘Segmentation_PointXYZI’, ‘Segmentation_PointXYZI_Normal’, ‘Segmentation_PointXYZRGB’, ‘Segmentation_PointXYZRGBA’, ‘Segmentation_PointXYZRGBA_Normal’, ‘Segmentation_PointXYZRGB_Normal’, ‘Sequence’, ‘StatisticalOutlierRemovalFilter’, ‘StatisticalOutlierRemovalFilter_PointXYZI’, ‘StatisticalOutlierRemovalFilter_PointXYZRGB’, ‘StatisticalOutlierRemovalFilter_PointXYZRGBA’, ‘VFHEstimation’, ‘Vertices’, ‘VoxelGridFilter’, ‘VoxelGridFilter_PointXYZI’, ‘VoxelGridFilter_PointXYZRGB’, ‘VoxelGridFilter_PointXYZRGBA’, ‘builtins’, ‘cached’, ‘doc’, ‘file’, ‘loader’, ‘name’, ‘package’, ‘path’, ‘spec’, ‘_encode’, ‘_infer_format’, ‘_pcl’, ‘deg2rad’, ‘load’, ‘load_PointWithViewpoint’, ‘load_XYZI’, ‘load_XYZRGB’, ‘load_XYZRGBA’, ‘np’, ‘numbers’, ‘rad2deg’, ‘save’, ‘save_PointNormal’, ‘save_XYZRGBA’, ‘sys’]

Any suggestion is appreciated.
Thanks
Salvatore

Maybe what you need is GitHub - strawlab/python-pcl: Python bindings to the pointcloud library (pcl). If not, then it is out there somewhere; you just need to find it :wink:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.