Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

程序运行报错 #2

Open
Gutsgwh1997 opened this issue Mar 9, 2020 · 2 comments
Open

程序运行报错 #2

Gutsgwh1997 opened this issue Mar 9, 2020 · 2 comments

Comments

@Gutsgwh1997
Copy link

distortion_adjust_ptr_->AdjustCloud(current_cloud_data_.cloud_ptr, current_cloud_data_.cloud_ptr);

bool DistortionAdjust::AdjustCloud(CloudData::CLOUD_PTR& input_cloud_ptr, CloudData::CLOUD_PTR& output_cloud_ptr) {
CloudData::CLOUD_PTR origin_cloud_ptr(new CloudData::CLOUD(*input_cloud_ptr));
output_cloud_ptr.reset(new CloudData::CLOUD());
...
}
这里的输入和输出不能是同一个指针,在里边的函数首先reset了。

@Little-Potato-1990
Copy link
Owner

你是运行的时候在这里报错了?还是看代码觉得这里有问题。
这里其实没问题,output_cloud_ptr被reset了,但是在reset之前,input_cloud_ptr的点云被保存在了origin_cloud_ptr里,所以点云并没有丢失。

@Gutsgwh1997
Copy link
Author

是我的问题,没有注意到函数体中的第一句代码。我运行时候出现(Assertion cloud.points.size() == cloud.width * cloud.height failed)错误,问题出现在去畸变后的cloud_pub_ptr_->Publish(),我将此函数的参数改为常引用了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants