结论:qvtkWidget->update();函数调用后要等一定时间刷新后才可以使用removePointCloud移除点云。
使用updatePointCloud函数正常显示,但是项目需要一定数据量后移除多余的点云,于是使用
removePointCloud函数移除。pcl版本1.8.1;vtk7.1.1;平台Ubuntu。一个线程处理数据,另一个线程更新显示,使用ui->qvtkWidget->update()刷新。
报错:
The inferior stopped because it received a signal from the operating system.
Signal name : | SIGSEGV |
Signal meaning : | Segmentation fault |
多数时候断点会跳转到:
renderTime = (initialized)?(aProp->GetRenderTimeMultiplier()):(1.0);
给个会报错的片段
ui->qvtkWidget->update();
// boost::this_thread::sleep(boost::posix_time::milliseconds(300)); //1
while(sub_maps_index.size() > 10 && test_flag) {
...
remove_submap_screen(submape_entry);// 2 viewer->removePointCloud(str);
...
}
ui->qvtkWidget->update();
最后发现注释1处延时超过一定时间后就不会有问题了,2处会调用removePointCloud()
贴个个人笔记:
编程实例问题pcl
http://t.zoukankan.com/zhaobinyouth-p-6198081.html