Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
true-real-michael committed Nov 22, 2023
1 parent 05bc25b commit 1cae797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion octreelib/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions octreelib/octree/octree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 1cae797

Please sign in to comment.