isl-org / isl-org/Open3D

Writing cutom attributes works for .ply files but fails for .pcd files

Open
#6,642 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### 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

```python
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

```markdown
- 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.