Robotics StackExchange | Archived questions

Working with PointCloud2Ptr

Hi!

I have a PointCloud2Ptr publishing node. Now I'm trying to figure out how the subscription works:

First I'm getting instant segmentation fault. That is until I remove all the pcl::StatisticalOutlierRemoval related stuff and leave only the pcl::PointCloud<pcl::PointXYZ>::ConstPtr p(&pclCloud); line. In that case however I'm getting

double free or corruption (out): 0x00007ffc588890e0 ***
Aborted (core dumped)

The incoming msg is valid and can be displayed in RViz. Can anyone shine some light upon this issue? Syntactically it's all good. The setInputCloud() works only with pcl::PointCloud<pcl::PointXYZ>::ConstPtr hence the need of creating one and assigning my converted cloud to it. The error might also be coming from the pcl::fromROSMsg(). Can this also be due to the fact that the information is shared and when the next message is generated it overwrites the one I'm working on leading to this conflict?

Asked by rbaleksandar on 2015-08-19 11:33:08 UTC

Comments

Answers

Already answered: http://answers.ros.org/question/210533/memory-corruption/ It's the way I define my pointer. The funny thing is that I have already done it the proper way a few lines above at PointCloudPtr pclCloud_filtered(new PointCloud); but pointing at an empty point cloud instance.

Asked by rbaleksandar on 2015-08-19 15:19:27 UTC

Comments