Skip to content

Commit

Permalink
start for point cloud tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorlouisdg committed Dec 12, 2023
1 parent 78aacc8 commit bd92be8
Show file tree
Hide file tree
Showing 6 changed files with 390 additions and 1 deletion.
1 change: 1 addition & 0 deletions airo-camera-toolkit/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
airo_camera_toolkit/image_transforms/tutorial_image.jpg
airo_camera_toolkit/calibration/saved_calibrations
**/calibration_20**/
notebooks/data
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import numpy as np
import open3d as o3d
from airo_typing import ColoredPointCloudType


def pointcloud_open3d_to_numpy(pcd: o3d.geometry.PointCloud) -> ColoredPointCloudType:
points = np.asarray(pcd.points).astype(np.float32)
colors = (np.asarray(pcd.colors) * 255).astype(np.uint8)
return points, colors


def pointcloud_numpy_to_open3d(pointcloud: ColoredPointCloudType) -> o3d.geometry.PointCloud:
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(pointcloud[0].astype(np.float64))
pcd.colors = o3d.utility.Vector3dVector(pointcloud[1].astype(np.float64) / 255)
return pcd
2 changes: 1 addition & 1 deletion airo-camera-toolkit/docs/rerun.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rerun.log_image("zed_top", image)
rerun.log_scalar("force_z", force[2])
...
```
See the [example notebook](./rerun-zed-example.ipynb) for more.
See the [example notebook](../notebooks/rerun-zed-example.ipynb) for more.

> :information_source: A note on starting the Rerun viewer: you can start it by calling `rerun.spawn()` from Python. However when starting Rerun like that, [there is no way to specify a memory limit](https://www.rerun.io/docs/howto/limit-ram). This quickly becomes a problem when logging images, so we recommend starting Rerun from a terminal:
>```
Expand Down
Loading

0 comments on commit bd92be8

Please sign in to comment.