koide3 / small_gicp

Efficient and parallel algorithms for point cloud registration [C++, Python]
MIT License
393 stars 51 forks source link

TypeError on Calling small_gicp.align() with PointCloud Objects #46

Closed Atticuszz closed 5 months ago

Atticuszz commented 5 months ago

Firstly,Your C++ code is remarkably well-crafted. The clarity and efficiency of your implementation are truly impressive, showcasing a high level of proficiency and attention to detail. It's a pleasure to work with such well-structured and robust code. Thank you for your excellent contribution to the community!

Description

When attempting to use the small_gicp.align() function with two instances of small_gicp.PointCloud and additional parameters such as registration_type, the function fails with a TypeError. It seems there might be a misunderstanding in the function's documentation or in the function's implementation regarding supported parameters.

Steps to Reproduce

  1. Initialize two small_gicp.PointCloud objects with point data.
  2. Attempt to align these point clouds using the small_gicp.align() function with the following code snippet:

    result = small_gicp.align(
       target=point_cloud_target,
       source=point_cloud_source,
       target_tree=kd_tree_target,  # Optional KD-Tree
       init_T_target_source=np.identity(4),
       max_correspondence_distance=0.1,
       registration_type=“GICP”,
       num_threads=4
    )
    here is the interfece that after pip install small_gicp,if i input small_gicp.PointCloud,there's no registration_type to select
    ```python
    def align(*args, **kwargs): # real signature unknown; restored from __doc__
    """
    align(*args, **kwargs)
    Overloaded function.
    
    1. align(target_points: numpy.ndarray[numpy.float64[m, n]], source_points: numpy.ndarray[numpy.float64[m, n]], init_T_target_source: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), registration_type: str = 'GICP', voxel_resolution: float = 1.0, downsampling_resolution: float = 0.25, max_corresponding_distance: float = 1.0, num_threads: int = 1) -> small_gicp.RegistrationResult
    
    2. align(target: small_gicp.PointCloud, source: small_gicp.PointCloud, target_tree: small_gicp.KdTree = None, init_T_target_source: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), max_correspondence_distance: float = 1.0, num_threads: int = 1, max_iterations: int = 20) -> small_gicp.RegistrationResult
    
    3. align(target_voxelmap: small_gicp.GaussianVoxelMap, source: small_gicp.PointCloud, init_T_target_source: numpy.ndarray[numpy.float64[4, 4]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), max_correspondence_distance: float = 1.0, num_threads: int = 1, max_iterations: int = 20) -> small_gicp.RegistrationResult
    """
    pass
koide3 commented 5 months ago

Thanks a lot for reporting the issue and opening the PR! I'm closing this issue as I just merged your PR.