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

FLANN & PCL segmentation fault with KdTree in Euclidean Cluster Extraction [closed]

asked 2013-01-21 06:29:05 -0500

updated 2014-04-20 14:09:42 -0500

ngrennan gravatar image

I am trying to perform euclidean cluster extraction under Ubuntu 12.04/11.10 (getting this error on both versions) and ROS Fuerte. The code for the clustering is below:

pcl::search::KdTree<pcl::PointXYZ>::Ptr tree ( new pcl::search::KdTree<pcl::PointXYZ>() );
tree->setInputCloud( input_point_cloud.makeShared() );
std::vector<pcl::PointIndices> *cluster_indices ( new std::vector<pcl::PointIndices>() );
std::vector<pcl::PointCloud<pcl::PointXYZ> > output_object_candidates; 

pcl::EuclideanClusterExtraction<pcl::PointXYZ> ec;
ec.setClusterTolerance( 0.01 ); // 2cm
ec.setMinClusterSize( 10 );
ec.setMaxClusterSize( 25000 );
ec.setSearchMethod( tree );
ec.setInputCloud( input_point_cloud.makeShared() );
ec.extract( *cluster_indices );

this leads to the following segmentation fault (with GDB 'bt' output):

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff36b11f4 in flann::KDTreeSingleIndex<flann::L2_Simple<float>   >::buildIndex() () from /opt/ros/fuerte/lib/libpcl_kdtree.so.1.5
(gdb) bt
#0  0x00007ffff36b11f4 in flann::KDTreeSingleIndex<flann::L2_Simple<float> >::buildIndex() () from /opt/ros/fuerte/lib/libpcl_kdtree.so.1.5
#1  0x00007ffff36a2938 in pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&,   boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) () from  /opt/ros/fuerte/lib/libpcl_kdtree.so.1.5
#2  0x00007ffff70b718f in pcl::search::KdTree<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) () from /opt/ros/fuerte/lib/libpcl_filters.so.1.5
#3  0x00007ffff63ee337 in object_candidate_extraction::extract_object_candidates (this=0x7fffffffdc10, input_point_cloud=..., object_candidates=...)
at /home/badrobit/ros_workspace/RoboCupAtWork/raw_object_perception/raw_safe_object_transportation/common/src/object_candidate_extraction.cpp:27
#4  0x0000000000450b9b in safe_object_transportation_node::get_point_cloud_data (this=0x7fffffffdb40, input_point_cloud=...)
at /home/badrobit/ros_workspace/RoboCupAtWork/raw_object_perception/raw_safe_object_transportation/ros/nodes/safe_object_transportation.cpp:54
#5  0x00000000004678d3 in boost::_mfi::mf1<void, safe_object_transportation_node, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (
this=0x7fffe4000ca8, p=0x7fffffffdb40, a1=...) at /usr/include/boost/bind/mem_fn_template.hpp:165
#6  0x0000000000465665 in boost::_bi::list2<boost::_bi::value<safe_object_transportation_node*>, boost::arg<1> >::operator()<boost::_mfi::mf1<void, safe_object_transportation_node, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list1<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&> > (
this=0x7fffe4000cb8, f=..., a=...) at /usr/include/boost/bind/bind.hpp:313
#7  0x0000000000462d4e in boost::_bi::bind_t<void, boost::_mfi::mf1<void, safe_object_transportation_node, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<safe_object_transportation_node*>, boost::arg<1> > >::operator()<boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> > (
this=0x7fffe4000ca8, a1=...) at /usr/include/boost/bind/bind_template.hpp:47
#8  0x0000000000460797 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf1<void, safe_object_transportation_node, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>, boost::_bi::list2<boost::_bi::value<safe_object_transportation_node*>, boost::arg<1> > >, void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::invoke (function_obj_ptr=..., a0=...) at /usr/include/boost/function/function_template.hpp:153
#9  0x00000000004659fb in boost::function1<void, boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&>::operator() (this=0x7fffe4000ca0, a0=...)
at /usr/include/boost/function/function_template.hpp:1013
#10 0x0000000000462efd in boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)>, void, boost::shared_ptr<sensor_msgs::PointCloud2_ ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by tfoote
close date 2014-09-09 00:32:28.453662

Comments

have you figure out the error?

ZsurzsaLaszlo gravatar image ZsurzsaLaszlo  ( 2013-05-27 03:16:12 -0500 )edit

I am sorry I have not.

BadRobot gravatar image BadRobot  ( 2013-06-21 21:43:05 -0500 )edit

Have you figured how to get Euclidean cluster extraction working in ros ecosystem?

pnambiar gravatar image pnambiar  ( 2014-08-18 09:12:39 -0500 )edit

I suggest asking on the pcl mailing list.

tfoote gravatar image tfoote  ( 2014-09-09 00:32:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-04-15 16:26:54 -0500

sai gravatar image

Try adding the header files

#include < / ..../perception_pcl/pcl/build/pcl_trunk/kdtree/include/pcl/kdtree/kdtree_flann.h>

#include < /.../perception_pcl/pcl/build/pcl_trunk/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp>

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-01-21 06:29:05 -0500

Seen: 2,217 times

Last updated: Apr 15 '14