Skip to content

Commit

Permalink
fix_naming
Browse files Browse the repository at this point in the history
  • Loading branch information
true-real-michael committed Oct 23, 2023
1 parent 3584da7 commit b4c8445
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion octreelib/grid/grid_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
6 changes: 3 additions & 3 deletions octreelib/grid/grid_with_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions octreelib/grid/static_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/grid/test_grid_with_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit b4c8445

Please sign in to comment.