copy a pointcloud but just copy a part of points data [closed]

asked 2015-04-24 17:52:38 -0500

crazymumu gravatar image

updated 2015-04-25 12:53:45 -0500

I want to copy a pointcloud to do transformpointCloud, but the data from pointcloud is too much, so I want to pickup one every 25 data.

pcl::PointCloud<pcl::PointXYZ>::Ptr simpleCloud(new pcl::PointCloud<pcl::PointXYZ>);
int cloudsize = (int)ceil((outputCloud1 -> width) * (outputCloud1 -> height)*1.0/25.0);
simpleCloud ->width =outputCloud1->width;
simpleCloud ->height =outputCloud1->height;
simpleCloud ->is_dense =outputCloud1->is_dense;
//simpleCloud ->sensor_origin_ =outputCloud1->sensor_origin_;
//simpleCloud ->sensor_orientation_ =outputCloud1->sensor_orientation_;
for(int i=0; i<cloudsize;i++)
   {

      simpleCloud ->points[i] = outputCloud1 -> points[i*25];

    }

Then everytime I launch this code, node died. Does anybody give me suggestions? Thanks very much.

I find solution in answer

edit retag flag offensive reopen merge delete

Closed for the following reason PCL Question: The PCL community prefers to answer questions at http://www.pcl-users.org/ by ahendrix
close date 2015-04-25 16:16:37.811736

Comments

1

Have you tried running your node in a debugger?

ahendrix gravatar image ahendrix  ( 2015-04-24 21:14:56 -0500 )edit

could you tell me how to run the node in a debugger

crazymumu gravatar image crazymumu  ( 2015-04-24 22:37:09 -0500 )edit

rosrun --prefix 'gdb --args' my_package my_node (you can use this for valgrind and other tools, too)

ahendrix gravatar image ahendrix  ( 2015-04-24 22:55:48 -0500 )edit

i do like you said, it just said "no debugging symbols found", could you explain a little bit more, or there are some examples? IseeGDB Tutorial,but coudn't undstand. Thanks for your time

crazymumu gravatar image crazymumu  ( 2015-04-24 23:27:09 -0500 )edit

You need to build you nodes in debug mode in order to have debug symbols. When you run catkin_make, add -DCMAKE_BUILD_TYPE=Debug

ahendrix gravatar image ahendrix  ( 2015-04-25 01:40:30 -0500 )edit

thanks so much.

crazymumu gravatar image crazymumu  ( 2015-04-25 12:27:57 -0500 )edit