Closed arunumd closed 4 years ago
@arunumd Please provide your file 1.pcd
. I tried the program with the auto-generated cloud (i.e. without command line parameter), and with a pcd file I have, but the segmentation fault did not occur. The problem might have been caused by your pcd file.
@arunumd To avoid a misunderstanding: this doesn't mean that this shouldn't be investigated. It is possible that there is a bug in pcl, or it lacks safety measures. Or did you already find out what the problem is?
Hi @mvieth, thanks for getting back. Since this file contained proprietary information, I had to manually crop-out the sensitive parts in the file and upload it. Right now I am also getting another new problem (couple of warning messages from pcl) apart from the original segmentation fault.
arun@arun-VirtualBox:~/Documents/playground/build$ ./range_image_visualization ../file.pcd
Failed to find match for field 'x'.
Failed to find match for field 'y'.
Failed to find match for field 'z'.
Segmentation fault (core dumped)
GitHub does not allow us to post a file with .pcd extension on the issues page. Hence, I have renamed my file.pcd to file.txt. Please rename the extension back to .pcd. This is the file below : file.txt
First insights: I put a debug here which gave: [pcl::RangeImage::getImagePoint] range=0, transformedPoint=(0,0,0), point=(0,0,0). And a debug here which gave: [pcl::RangeImage::asinLookUp] called asinLookUp(value=-nan).
So I guess the question is why is there a point (0,0,0) if it is not in the initial cloud and where should the test go that prevents this segfault. I will get back to you when I know more.
@arunumd Could you please put this code at line 114 of the tutorial (between reading in the cloud and creating the range image) and post the result here:
std::cout << "point_cloud=" << point_cloud << std::endl;
for(size_t i=0; i<10; i++) {
std::cout << point_cloud[i] << std::endl;
}
Please use the original file (containing the sensitive parts). That one did not give you messages like Failed to find match for field
, did it?
Thanks in advance.
@arunumd Where did you get the PCD file from/how did you generate it, if you don't mind me asking? I noticed that it uses 64bit floats instead of the 32bit floats PCL usually uses (as far as I know).
One problem seems to be that PCL does not recognize the fields x, y, z when reading the file because they don't have the expected type (double instead of float). The cloud then only consists of (0,0,0) points, which causes the segfault.
@arunumd Where did you get the PCD file from/how did you generate it, if you don't mind me asking? I noticed that it uses 64bit floats instead of the 32bit floats PCL usually uses (as far as I know).
One problem seems to be that PCL does not recognize the fields x, y, z when reading the file because they don't have the expected type (double instead of float). The cloud then only consists of (0,0,0) points, which causes the segfault.
Dear @mvieth. Thanks for trying to investigate this. I was not sure what was causing the cloud with (0, 0, 0). I used software for editing my raw point cloud. I also realized that the software increased the float precision further when I processed the point cloud and saved it as a new .pcd file. I think your suggestion was right. I tried to set the precision of the .pcd file as the same precision it was originally. The problem got solved.
Thanks for getting back on this @arunumd
My Environment
Context
I am trying to convert a point cloud into a range image. I followed the tutorials on this page. But I get a segmentation fault when I do exactly the same thing said in the tutorial.
Expected Behavior
The code from the tutorial above should output a range image.
Current Behavior
The code fails with a segmentation fault and does not create a range image.
Code to Reproduce
Following the code in this tutorial produces the bug found below in the error.txt file
I ran the following commands to run this code :
The error generated through valgrind tool is attached below : error.txt