Adds a point to the
File3D object. This should be a 3D point with an x, y and z values.
- x (float): X value of the point
- y (float): Y value of the point
- z (float): Z value of the point
- intensity(float): (Optional) intensity value. Useful for lidar sensor context.
- device_id(str): (Optional) sensor or device identificator. This can be useful when users want to combine data from multiple sensors on the same point cloud.
- timestamp(Date): (Optional) a Date object to identify the timestamp of the given points
- is_ground(bool): (Optional) Identify a point as a ground point.
A list of all the points in the
File3D object, including the newly added point.
# Please replace test_point_cloud.pcd with you PCD file for parsing. # We are assuming PCD file is not in binary form diffgram_3d_file = File3D(client = project, name = 'test_point_cloud.pcd') points_arr =  # Open PCD File with open('test_point_cloud.pcd') as f: lines = f.readlines() is_on_points = False # Loop through each line of the PCD File and parse the X,Y,Z Points. for line in lines: if not is_on_points: if line.startswith('DATA'): is_on_points = True else: data = line.split(' ') row =  for elm in data: row.append(float(elm)) row = min((row / 100, 1.0)) points_arr.append(row) for i in range(0, len(points_arr)): point = points_arr[i] # Add point data to Diffgram File3D object. diffgram_3d_file.add_point( x = point, y = point, z = point, intensity = point )
Updated almost 2 years ago