Using pcl::VoxelFilter with PointCloud2 leads to crash [closed]

asked 2013-06-06 14:04:32 -0600

Alan Meekins gravatar image

updated 2014-04-20 14:09:34 -0600

ngrennan gravatar image

I've been porting working code from fuerte to groovy and ran into a strange crash in ros_pcl, since both are based on pcl1.6 it seems that this is may be a Groovy induced bug. The below code crashes with an "Illegal Instruction" when filter() is called on the VoxelFilter. Any ideas whats going wrong?

void pointCloudCallback (const sensor_msgs::PointCloud2Ptr& input) {
    std::cout << "Input cloud size " << input->data.size() << std::endl;
    if(input->data.size() <= 0){

    sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2);
    sensor_msgs::PointCloud2 downSampledInput;

    //Downsample input point cloud
    pcl::VoxelGrid<sensor_msgs::PointCloud2> downsample;
    downsample.setLeafSize(0.20f, 0.20f, 0.20f);
    downsample.filter(downSampledInput);     //Illegal Instruction here

    //Transform into base_link
        pcl_ros::transformPointCloud(string("/base_link"), downSampledInput, *cloud, *_tfListener);
    catch(tf::TransformException ex){
        ROS_ERROR("TFException %s",ex.what());


Call Stack:

pcl::VoxelGrid<sensor_msgs::PointCloud2_<std::allocator<void> > >::applyFilter(sensor_msgs::PointCloud2_<std::allocator<void> >&)   /opt/ros/groovy/lib/
pcl::Filter<sensor_msgs::PointCloud2_<std::allocator<void> > >::filter(sensor_msgs::PointCloud2_<std::allocator<void> >&)   /opt/ros/groovy/lib/
pointCloudCallback  point_downsample_node.cpp
edit retag flag offensive reopen merge delete

Closed for the following reason PCL Question: The PCL community prefers to answer questions at by tfoote
close date 2016-09-22 20:42:08.787517


Crash occurs even when pcl::VoxelGrid<pcl::PointXYZ> is used with converted point clouds. Call stack is the same

Alan Meekins gravatar image Alan Meekins  ( 2013-06-06 14:27:30 -0600 )edit

Do you have the most recent version of the pcl libs? There was an update 2 or 3 days ago which fixed an error causing "Illegal instruction" errors.

alex_rockt gravatar image alex_rockt  ( 2013-06-06 20:18:53 -0600 )edit

Which packages are you referring to? So since my initial post I've updated the machine from Ubuntu 12.04 to 12.10, purged all of ROS and did a reinstall using the Quantal packages. Then ran

sudo apt-get install ros-groovy-pcl*

Still getting illegal instruction crashes

Alan Meekins gravatar image Alan Meekins  ( 2013-06-07 14:11:56 -0600 )edit

Hey, sorry, I ignored that you are on groovy. The groovy packages were updated yesterday I think. So you should try to update again.

alex_rockt gravatar image alex_rockt  ( 2013-06-09 20:07:51 -0600 )edit

Hey, I ve got the same issue, but moving on.. My System: Ubuntu 12.04 LTS Intel® Core™2 Duo CPU E6550 @ 2.33GHz × 2 with 4GB RAM

Josef gravatar image Josef  ( 2013-06-26 01:37:34 -0600 )edit