isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.35k stars 2.29k forks source link

Index Error when running Registration from ROS Noetic from tensor-CUDA #5421

Closed johnd2010 closed 2 years ago

johnd2010 commented 2 years ago

Checklist

Describe the issue

Hi,

Thank you for all the support provided on Open3d.

Objective : To run simple icp registration on two point clouds of type <class 'open3d.cuda.pybind.t.geometry.PointCloud'>.

Steps to reproduce the bug

source and target are simple open3d pointcloud objects
Code Snippet : 
            source_new = o3d.t.geometry.PointCloud()
            target_new = o3d.t.geometry.PointCloud()
            source_new.from_legacy(source)
            source_new.cuda(0)
            target_new.from_legacy(target)
            target_new.cuda(0)

            s = time.time()
            print("----------------------")
            print(type(target_new))
            print("----------------------")
            reg_p2p = o3d.t.pipelines.registration.icp(target_new, source_new, 10.0)

However, the example code that was shared

Error message

Issue/Error: Traceback (most recent call last): File "/home/durable20/durable_stuff_ubuntu_20/src/georeference_pcl/scripts/matching_node", line 6, in node.main() File "/home/durable20/durable_stuff_ubuntu_20/src/georeference_pcl/src/georeference_pcl_ros/matching_node.py", line 539, in main obj.run() File "/home/durable20/durable_stuff_ubuntu_20/src/georeference_pcl/src/georeference_pcl_ros/matching_node.py", line 230, in run transform = self.open3dICP3d(sphere_o3d, scan_o3d,sphere_ground,scan_ground) File "/home/durable20/durable_stuff_ubuntu_20/src/georeference_pcl/src/georeference_pcl_ros/matching_node.py", line 351, in open3dICP3d reg_p2p = o3d.t.pipelines.registration.icp(target_new, source_new, self.icp_max_corr_distance) IndexError: _Map_base::at

Expected behavior

No response

Open3D, Python and System information

- Operating system: Ubuntu 20.04 
- Python version: Python 3.9
- Open3D version: output from python: `0.15.2`
- System architecture: x86 
- Is this a remote workstation?:  no
- How did you install Open3D?: pip

Additional information

When attempting to run the example code shared on the open3d website(http://www.open3d.org/docs/latest/tutorial/t_pipelines/t_icp_registration.html#Multi-Scale-ICP-on-CUDA-device-Example), we do not face the issue.

The code also works when we do not use tensors, i.e, when we use the simple open3d pointcloud object

johnd2010 commented 2 years ago
        source_new = source_new.from_legacy(source)
        # source_new.cuda(0)
        target_new = target_new.from_legacy(target)
        # target_new.cuda(0)

        This change in code cleared the error. Thanks and sorry for any confusion caused