PRBonn / kiss-icp

A LiDAR odometry pipeline that just works
https://www.ipb.uni-bonn.de/wp-content/papercite-data/pdf/vizzo2023ral.pdf
MIT License
1.52k stars 308 forks source link

Add support to read timestamps from pcd/ply files #176

Open nachovizzo opened 1 year ago

nachovizzo commented 1 year ago

If deskewing is required, the current generic dataloader is not loading (and thus, discarding) the timestamp information. Should be easy to do it. I tried with PlyData but it's really slow!

snippet that works (but too slow)

cloud = PlyData.read(file_path)
data = cloud["vertex"].data
points = np.vstack([data[name] for name in ["x", "y", "z"]]).T
timestamps = np.asarray(data["t"])
timestamps = timestamps / timestamps.max()
return points.astype(np.float64), timestamps

The old API from open3d also does not support this, maybe migrating to the tensor API helps (?)

jpaulos commented 1 year ago

I regularly use the new open3d Tensor API to read/write extra point data like timestamps from .pcd files.

An example of what that API looks like, tested out of context:

import open3d as o3d
import open3d.core as o3c

pc = o3d.t.io.read_point_cloud(file_path)
points = pc.point.positions.numpy() # Here 'positions' is the special reserved attribute name for xyz data.
timestamps = pc.point.t.numpy() # Here 't' is a user-defined extra attribute name in the .pcd file.
timestamps = timestamps / timestamps.max()
return points, timestamps

The gotcha which is why I'm commenting: From what I can see, the Open3d Tensor API .pcd file writer (and I believe file reader) can not work with point clouds larger than 2**31 bytes (about 2.1 GB). I think this limitation isn't a major pain point in the open3d community and the resolution would require a rethink of their file writer's approach, so I don't expect much traction on the open issue.

https://github.com/isl-org/Open3D/issues/6043

iegorval commented 11 months ago

Is this still not implemented / not having anyone working on it?