pclpy_tutorial
pclpy_tutorial copied to clipboard
请问有遇到过Segmentation fault得问题吗
我在docker中通过conda安装了pclpy,结果使用hull时报错Segmentation fault
可以贴一下代码片段和报错信息吗
hull.reconstruct 报错,在windows下没问题,在linux下会报错
from pclpy import pcl
tb = pcl.PointCloud.PointXYZ()
tb = tb.from_array(vertexes) # 凸包顶点
hull = pcl.surface.ConvexHull.PointXYZ()
hull.setInputCloud(tb)
hull.setDimension(3)
polygon = pcl.vectors.Vertices() # 凸包顶点
surface_hull = pcl.PointCloud.PointXYZ() # 凸包形状
hull.reconstruct(surface_hull, polygon) # 计算凸包
我暂时使用以下方法代替该方法了
from scipy.spatial import ConvexHull
hull = ConvexHull(vertexes)
polygon = self.list_to_vertices(hull.simplices)
surface_hull = pcl.PointCloud.PointXYZ()
surface_hull = surface_hull.from_array(vertexes) # 凸包顶点
return hull, surface_hull, polygon
vertexes=[
[
-11.620271234832265,
2.640974040337443,
-2.043000030517578
], [
-11.620271234832265,
2.640974040337443,
-0.1389999955892563
], [
-9.08636688079943,
2.105642134555592,
-2.043000030517578
], [
-9.08636688079943,
2.105642134555592,
-0.1389999955892563
], [
-7.444682369735905,
0.17844727374092292,
-2.043000030517578
], [
-7.444682369735905,
0.17844727374092292,
-0.1389999955892563
], [
-10.620985010706638,
-3.6402536541696238,
-2.043000030517578
], [
-10.620985010706638,
-3.6402536541696238,
-0.1389999955892563
], [
-11.834403997144898,
-3.8900752102011564,
-2.043000030517578
], [
-11.834403997144898,
-3.8900752102011564,
-0.1389999955892563
], [
-13.1192005710207,
-3.783008829044784,
-2.043000030517578
], [
-13.1192005710207,
-3.783008829044784,
-0.1389999955892563
], [
-14.368308351177733,
-3.0692329546689816,
-2.043000030517578
], [
-14.368308351177733,
-3.0692329546689816,
-0.1389999955892563
], [
-15.653104925053537,
-0.6067061880724615,
-2.043000030517578
], [
-15.653104925053537,
-0.6067061880724615,
-0.1389999955892563
], [
-16.152748037116346,
1.7487541973676899,
-2.043000030517578
], [
-16.152748037116346,
1.7487541973676899,
-0.1389999955892563
], [
-15.046395431834405,
3.3904387084320367,
-2.043000030517578
], [
-15.046395431834405,
3.3904387084320367,
-0.1389999955892563
], [
-13.261955745895792,
3.568882677025988,
-2.043000030517578
], [
-13.261955745895792,
3.568882677025988,
-0.1389999955892563
]]