ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

segfault from PCL SHOTEstimationOMP

asked 2015-01-29 02:18:27 -0500

Matthew.J gravatar image

updated 2015-01-29 09:39:44 -0500

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.

edit retag flag offensive close merge delete

Comments

A gdb trace would be nice, are you using c++11 ? Maybe you are facing this issue.

VictorLamoine gravatar image VictorLamoine  ( 2015-01-29 03:11:31 -0500 )edit

Added gdb backtrace. I haven't specified standard.

Matthew.J gravatar image Matthew.J  ( 2015-01-29 04:36:25 -0500 )edit

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

sai gravatar image sai  ( 2015-01-29 07:49:05 -0500 )edit

My includes were fine... I asked on the forum you suggested. Thx for advice.

Matthew.J gravatar image Matthew.J  ( 2015-01-29 10:35:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-31 11:03:37 -0500

Matthew.J gravatar image

Turns out it was neither PCL nor ROS problem. There was something broken in my OS.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-01-29 02:18:27 -0500

Seen: 704 times

Last updated: Jan 31 '15