From 1cae7977cb986ab685e732001bbb457373c52a58 Mon Sep 17 00:00:00 2001 From: Mikhail Kiselyov Date: Wed, 22 Nov 2023 15:13:43 +0300 Subject: [PATCH] fix comments --- octreelib/grid/grid.py | 2 +- octreelib/octree/octree.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/octreelib/grid/grid.py b/octreelib/grid/grid.py index 2d13339..c6c63fd 100644 --- a/octreelib/grid/grid.py +++ b/octreelib/grid/grid.py @@ -67,7 +67,7 @@ def insert_points(self, pose_number: int, points: PointCloud): # Register pose self.__pose_voxel_coordinates[pose_number] = [] - # Distribute points to voxels using numpy operations + # Distribute points to voxels voxel_indices = ( (points - self._grid_config.corner) // self._grid_config.voxel_edge_length ) * self._grid_config.voxel_edge_length diff --git a/octreelib/octree/octree.py b/octreelib/octree/octree.py index a8833e7..d37ddb2 100644 --- a/octreelib/octree/octree.py +++ b/octreelib/octree/octree.py @@ -71,6 +71,8 @@ def insert_points(self, points: PointCloud): child_indices_for_points = ( (points - self.corner_min) // (self.edge_length / 2) ).astype(int) + + # Create a unique identifier for each voxel based on its indices unique_indices, inverse_indices = np.unique( child_indices_for_points, axis=0, return_inverse=True )