Open3D
Open3D copied to clipboard
Writing cutom attributes works for .ply files but fails for .pcd files
Checklist
- [X] I have searched for similar issues.
- [X] For Python issues, I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
mainbranch).
Describe the issue
I have been trying to save intensity values in a .pcd file. Although creating the file and writing the points are successful, it is still missing the added intesity values. I have seen other issues discussing the matter, but it is still unclear whether writing custom attributes would be supported for PCD file formats. Below is a simple code to replicate the issue:
Steps to reproduce the bug
import open3d as o3d
import numpy as np
points = np.random.rand(1000, 3)
intensities = np.random.rand(1000, 1)
dtype = o3d.core.Dtype.Float32
pcd = o3d.t.geometry.PointCloud(o3d.core.Tensor(points, dtype=dtype))
pcd.point["intensities"] = o3d.core.Tensor(intensities, dtype=dtype)
o3d.t.io.write_point_cloud('./test_ply.ply', pcd)
o3d.t.io.write_point_cloud('./test_pcd.pcd', pcd)
point_cloud_ply = o3d.t.io.read_point_cloud('./test_ply.ply')
print(f"PLY point cloud: {point_cloud_ply}")
point_cloud_pcd = o3d.t.io.read_point_cloud('./test_pcd.pcd')
print(f"PCD point cloud: {point_cloud_pcd}")
Error message
PLY point cloud: PointCloud on CPU:0 [1000 points (Float32)] Attributes: intensities (Float32, 1). PCD point cloud: PointCloud on CPU:0 [1000 points (Float64)] Attributes: None.
Expected behavior
Written custom attributes should exist for PCD file formats (i.e: not None)
Open3D, Python and System information
- Operating system: Ubuntu 20.04
- Python version: Python 3.9.2
- Open3D version: 0.13.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
Additional information
No response
maybe u can update your open3d. 0.17.0 works fine for .pcd file