segfault from PCL SHOTEstimationOMP
I have a seg fault problem. I tried to run it with valgrind but I can't figure what caused the problem from the results. I also tried gdb but the results aren't much better. I don't see where the problem came from.
Some context for seg fault
global:
pcl::PointCloud<PointType>::Ptr modelPtr (new pcl::PointCloud<PointType> ());
pcl::PointCloud<PointType>::Ptr model_keypoints (new pcl::PointCloud<PointType> ());
in main:
if (pcl::io::loadPCDFile (model_filename_, *modelPtr) < 0)
{
std::cout << "pcl::io::loadPCDFile error" << std::endl;
return (-1);
}
in callback function:
pcl::NormalEstimationOMP<PointType, NormalType> norm_est;
norm_est.setKSearch (10);
norm_est.setInputCloud (modelPtr);
norm_est.compute (*model_normals);
pcl::copyPointCloud (*modelPtr, sampled_indices.points, *model_keypoints);
pcl::SHOTEstimationOMP<PointType, NormalType, DescriptorType> descr_est;
descr_est.setRadiusSearch (descr_rad_);
descr_est.setInputCloud (model_keypoints);
descr_est.setInputNormals (model_normals);
descr_est.setSearchSurface (modelPtr);
descr_est.compute (*model_descriptors); //segfault
Any ideas what could be the cause of this problem?
Edit: gdb backtrace results are here.
Edit2: I also get this warning from building this node
In file included from /usr/include/c++/4.6/backward/strstream:52:0,
from /usr/include/vtk-5.8/vtkIOStream.h:112,
from /usr/include/vtk-5.8/vtkSystemIncludes.h:40,
from /usr/include/vtk-5.8/vtkIndent.h:24,
from /usr/include/vtk-5.8/vtkObjectBase.h:43,
from /usr/include/vtk-5.8/vtkSmartPointerBase.h:26,
from /usr/include/vtk-5.8/vtkSmartPointer.h:23,
from /usr/include/pcl-1.7/pcl/visualization/point_cloud_geometry_handlers.h:48,
from /usr/include/pcl-1.7/pcl/visualization/point_cloud_handlers.h:41,
from /usr/include/pcl-1.7/pcl/visualization/common/actor_map.h:40,
from /usr/include/pcl-1.7/pcl/visualization/pcl_visualizer.h:47,
from /home/ros-user/catkin_ws/src/kinect_pr2/src/subscriber.cpp:15:
/usr/include/c++/4.6/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
But line 15 is #include <pcl/visualization/pcl_visualizer.h>
so it will be probably unrelated.
A
gdb
trace would be nice, are you usingc++11
? Maybe you are facing this issue.Added gdb backtrace. I haven't specified standard.
best place to ask pcl questions would be its forum http://www.pcl-users.org/ Here is a possible solution http://smrpn.blogspot.sg/2014/02/kdtree-headers-in-pcl.html
My includes were fine... I asked on the forum you suggested. Thx for advice.