koide3 / hdl_localization

Real-time 3D localization using a (velodyne) 3D LIDAR
BSD 2-Clause "Simplified" License
775 stars 310 forks source link

NDT_CUDA_D2D #110

Open qzsrh opened 1 year ago

qzsrh commented 1 year ago

when i use the reg_method=NDT_CUDA_D2D, An error has occurred:

terminate called after throwing an instance of 'thrust::system::system_error' what(): for each:failed to synchronize: cudaErrorIllegalAddress: an illegal memory acess was encountered

The error is located in this step: //transform pointcloud into odom_child_frame_id if(this->tf_buffer.canTransform(odom_child_frame_id, pcl_cloud->header.frame_id, stamp, ros::Duration(0.1), &tfError))

But I don't know why it went wrong and how to fix it。 Please help me, thank you very much!

bigpigdog commented 6 months ago

@qzsrh Hello! Same error as you, did you solve it?

qzsrh commented 6 months ago

@qzsrh Hello! Same error as you, did you solve it? 我把这一部分注释了 if(this->tf_buffer.canTransform(odom_child_frame_id, pcl_cloud->header.frame_id, stamp, ros::Duration(0.1), &tfError)) { if(!pcl_ros::transformPointCloud(odom_child_frame_id, pcl_cloud, cloud, this->tf_buffer)) { NODELET_ERROR("point cloud cannot be transformed into target frame!!"); return; } }else { NODELET_ERROR(tfError.c_str()); return; }

bigpigdog commented 6 months ago

@qzsrh Thanks for reply! 不过我注释掉了这一段,他刚开始就报错了(难道是我提供了odom -> base_link transform吗)“terminate called after throwing an instance of 'thrust::system::detail::bad_alloc' what(): std::bad_alloc: cudaErrorMemoryAllocation: out of memory”;不同与之前的“cudaErrorIllegalAddress”,之前有这个错误,但他还能运行一段时间。 你是怎么定位你的错误在这一段的呢?

qzsrh commented 6 months ago

不过我注释掉了这一段,他刚开始就报错了(

新的错误大概率是因为参数配置的不合理,点云数据较大匹配计算的时候超出gpu的承受能力了,你可以把downsample_resolution这个参数设置的大一些

bigpigdog commented 6 months ago

新的错误大概率是因为参数配置的不合理,点云数据较大匹配计算的时候超出gpu的承受能力了,你可以把downsample_resolution这个参数设置的大一些

好像修改downsample_resolution没有什么效果,还是运行会报错,并且那段代码我不能注释掉。 不过还好P2D的运行还算正常,我发现我使用P2D和D2D的使用GPU只占用2%(56MiB),这正常吗

qzsrh commented 6 months ago

新的错误大概率是因为参数配置的不合理,点云数据较大匹配计算的时候超出gpu的承受能力了,你可以把downsample_resolution这个参数设置的大一些

好像修改downsample_resolution没有什么效果,还是运行会报错,并且那段代码我不能注释掉。 不过还好P2D的运行还算正常,我发现我使用P2D和D2D的使用GPU只占用2%(56MiB),这正常吗

取决你的点云地图大小,但只要定位结果正常,问题应该不大

bigpigdog commented 6 months ago

取决你的点云地图大小,但只要定位结果正常,问题应该不大

那就只能先用P2D算法了,总之谢谢你的解答!

hwy0606 commented 6 months ago

是Eigen版本的冲突问题,fast_gicp/third_party下有一个Eigen,要用这个版本。直接catkin_make编译会用系统里的自带版本。可以先catkin_make --pkg fast_gicp,再全部编译就好了

bigpigdog commented 5 months ago

是Eigen版本的冲突问题,fast_gicp/third_party下有一个Eigen,要用这个版本。

非常好使!感谢!