pcl
pcl copied to clipboard
[range_image] range_image creation samplecode not working with PCL-1.13.1-AllInOne-msvc2022-win64.exe
I tried to create a range_image using the documentation samplecode https://pcl.readthedocs.io/projects/tutorials/en/latest/range_image_creation.html and I have an Access violation error in the function RangeImage::createFromPointCloud line 134 points.resize (size, unobserved_point);
Environment
- OS: Windows 10 Entreprise
- Compiler: msvc2022
- PCL Version1.13.1-AllInOne-msvc2022-win64.exe
I can reproduce it, but for some reason its only for the pcl::RangeImage, which inherits from pointcloud, where the point type is PointWithRange.
If I just make a pointcloud with same pointtype, it doesn't crash on the nullptr.
@mvieth Do you have any suggestions? I have tried various stuff with AVX, Eigen alignment etc, CXX14 vs higher.
@mvieth, a solution would be appreciated as we are really need the concept of class pcl::RangeImage
I also did some tests and yes, it looks like an alignment problem. The first and last pointers of the points vector (which mark the used range) were both 0, but the end pointer (which marks the end of the memory belonging to the vector) was something like 0xcccccccccc01.
However, with the PCL 1.13.0 all-in-one installer, it works fine. @larshg Did you try with PCL 1.13.1 from vcpkg? I am wondering whether the 1.13.1 version has a problem or only the 1.13.1 all-in-one installer ...
I also did some tests and yes, it looks like an alignment problem. The first and last pointers of the
pointsvector (which mark the used range) were both 0, but the end pointer (which marks the end of the memory belonging to the vector) was something like 0xcccccccccc01. However, with the PCL 1.13.0 all-in-one installer, it works fine. @larshg Did you try with PCL 1.13.1 from vcpkg? I am wondering whether the 1.13.1 version has a problem or only the 1.13.1 all-in-one installer ...
Yeah, I also tried the 1.13.1 all-in-one installer. I'm currently installing 1.13.1 from vcpkg.
It works fine with pcl from vcpkg as well. So seems to be the All-in-one installer. @UnaNancyOwen could you try test this? Do you have any idea to what it could be?
@larshg I was confirmed that this sample code does not work with PCL installed using PCL All-in-one Installer. As he says, RangeImage::createFromPointCloud causes an error. However, I don't know the details of the cause yet. (Actually, I've been looking into this problem for some time now, but couldn't figure out what caused it for me. I throw in the towel.) Possibly, there is a difference in build options between vcpkg and All-in-one Installer? We need help from someone who can investigate in detail.
I just tested with the PCL 1.14.0 all-in-one installer, and it works. So the error only happens with the PCL 1.13.1 all-in-one installer. Other PCL versions work with the all-in-one installer. When using vcpkg, all PCL versions work (including 1.13.1). My best guess is that there was some kind of error when the PCL 1.13.1 all-in-one installer was created. @UnaNancyOwen maybe it would be worth it to re-create the PCL 1.13.1 all-in-one installer and upload the new one to GitHub?
I re-built PCL 1.13.1 from source code. But that tutorial range_image_creation didn't work with PCL 1.13.1 on my emvironment. I don't know what caused this. :( However, it seems to work with PCL 1.14.0, luckily. I think it is better to use the latest version than to try to fix past versions.
Let's close this. I don't know how else to investigate, and using the PCL 1.14.0 or 1.14.1 all-in-one installer (or vcpkg) seems to be a good solution.