Skip to content

Commit

Permalink
feat: add example script for spires_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
YifuTao committed Sep 17, 2024
1 parent 7d97306 commit abb5c89
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spires_cpp/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from spires_cpp import OcTree, convertOctreeToPointCloud, removeUnknownPoints, processPCDFolder

pcd_folder = "/home/yifu/data/nerf_data_pipeline/2024-03-13-maths_1/raw/individual_clouds_new"
resolution = 0.1
save_path = "/home/yifu/data/nerf_data_pipeline/2024-03-13-maths_1/raw/individual_clouds_new.bt"
processPCDFolder(pcd_folder, resolution, save_path)


octomap_bt_path = "/home/yifu/data/nerf_data_pipeline/2024-03-13-maths_1/raw/individual_clouds_new.bt"
octree = OcTree(octomap_bt_path)
print(octree.getResolution())
print(octree.size())
print(octree.getTreeDepth())


octomap_bt_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/gt_cloud.bt"
input_cloud_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/input_cloud_occ.pcd"
output_cloud_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/input_cloud_occ_filtered.pcd"
removeUnknownPoints(input_cloud_path, octomap_bt_path, output_cloud_path)


octomap_bt_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/gt_cloud.bt"
occ_cloud_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/gt_cloud_occ.pcd"
free_cloud_path = "/home/yifu/workspace/Spires_2025/2024-03-13-maths_1/gt_cloud_free.pcd"
convertOctreeToPointCloud(octomap_bt_path, free_cloud_path, occ_cloud_path)

0 comments on commit abb5c89

Please sign in to comment.