Gavin
2021-02-04 4e5aaefc7162b700b95c750caeff35e6323631d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pandas as pd 
import numpy as np
import matplotlib.pyplot as plt
import pcl
import pcl.pcl_visualization
 
 
data = pd.read_csv("D:\\test\\Sample.csv")
dataArray = np.array(data)
cloud = pcl.PointCloud(np.float32(dataArray[:,0:3]))
pcl.save(cloud,"D:\\test\\Sample.pcd")
 
viewer = pcl.pcl_visualization.PCLVisualizering('3D Viewer')
pccolor = pcl.pcl_visualization.PointCloudColorHandleringCustom(cloud, 255, 255, 255)
viewer.AddPointCloud_ColorHandler(cloud, pccolor)
 
 
 
flag = True
while flag:
    flag != viewer.WasStopped()
    viewer.SpinOnce()
    # pcl_sleep (0.01)
    # pass
end