copy a pointcloud but just copy a part of points data [closed]
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
Have you tried running your node in a debugger?
could you tell me how to run the node in a debugger
rosrun --prefix 'gdb --args' my_package my_node
(you can use this for valgrind and other tools, too)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
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
thanks so much.