Skip to content

Commit

Permalink
add astype to the previous operation
Browse files Browse the repository at this point in the history
  • Loading branch information
true-real-michael committed Nov 22, 2023
1 parent 1cae797 commit 01f5ef8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions octreelib/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ def insert_points(self, pose_number: int, points: PointCloud):

# Distribute points to voxels
voxel_indices = (
(points - self._grid_config.corner) // self._grid_config.voxel_edge_length
) * self._grid_config.voxel_edge_length
voxel_indices = voxel_indices.astype(int)
(points - self._grid_config.corner)
// self._grid_config.voxel_edge_length
* self._grid_config.voxel_edge_length
).astype(int)

# Create a unique identifier for each voxel based on its indices
unique_indices, inverse_indices = np.unique(
Expand Down

0 comments on commit 01f5ef8

Please sign in to comment.