diff --git a/octreelib/grid/grid_base.py b/octreelib/grid/grid_base.py index e889bc2..25f748e 100644 --- a/octreelib/grid/grid_base.py +++ b/octreelib/grid/grid_base.py @@ -17,7 +17,7 @@ class GridConfigBase(ABC): octree_type: type of Octree used octree_config: config to be forwarded to the octrees - min_voxel_size: size of a minimal possible voxel, the octree will be able to subdivide to + grid_voxel_edge_length: size of a minimal possible voxel, the octree will be able to subdivide to corner: corner of a grid debug: debug mode """ diff --git a/octreelib/grid/grid_with_points.py b/octreelib/grid/grid_with_points.py index 9ba1d6e..872b2b0 100644 --- a/octreelib/grid/grid_with_points.py +++ b/octreelib/grid/grid_with_points.py @@ -104,8 +104,8 @@ def _get_voxel_for_point(self, point: Point) -> Point: :param point: Point. :return: Corner of the voxel in the grid, where an appropriate octree for the point resides. """ - min_voxel_size = self.grid_config.min_voxel_size - return point // min_voxel_size * min_voxel_size + grid_voxel_edge_length = self.grid_config.grid_voxel_edge_length + return point // grid_voxel_edge_length * grid_voxel_edge_length def insert_points(self, pose_number: int, points: List[Point]): # register pose if it is not registered yet @@ -129,7 +129,7 @@ def insert_points(self, pose_number: int, points: List[Point]): self.octrees[voxel_coordinates_hashable] = self.grid_config.octree_type( self.grid_config.octree_config, voxel_coordinates, - self.grid_config.min_voxel_size, + self.grid_config.grid_voxel_edge_length, ) self.octrees[voxel_coordinates_hashable].insert_points([point]) diff --git a/octreelib/grid/static_grid.py b/octreelib/grid/static_grid.py index 3f64d3a..2c7333b 100644 --- a/octreelib/grid/static_grid.py +++ b/octreelib/grid/static_grid.py @@ -59,8 +59,8 @@ def get_points(self, pose_number: int) -> List[Point]: return self.octrees[pose_number].get_points() def _floor_point(self, x: Point) -> Point: - min_voxel_size = self.grid_config.grid_voxel_edge_length - return x // min_voxel_size * min_voxel_size + grid_voxel_edge_length = self.grid_config.grid_voxel_edge_length + return x // grid_voxel_edge_length * grid_voxel_edge_length def _ceil_point(self, x: Point) -> Point: return self._floor_point(x) + 1 diff --git a/test/grid/test_grid_with_points.py b/test/grid/test_grid_with_points.py index 67609a8..9ec2247 100644 --- a/test/grid/test_grid_with_points.py +++ b/test/grid/test_grid_with_points.py @@ -15,7 +15,7 @@ def generated_grid(): GridWithPointsConfig( octree_type=MultiPoseOctree, octree_config=MultiPoseOctreeConfig(), - min_voxel_size=5, + grid_voxel_edge_length=5, ) ) points_0 = [