-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add precompiled computeApproximateCovariances
; fix compilation error for the same
#3711
Conversation
This bug was most likely introduced when for loops were changed into foreach ones.
The green CI implies that there is no cpp file (no test, no lib) including this at all. Is there any way to fix the lack of compilation? |
If I actually knew what the function did, how to use it, etc. I'd gladly contribute a test but I'm not the user myself so I unfortunately don't have a ready-made test :/ |
To clarify, I don't think a test is needed, just some way we can compile this header. A test is good, but for 1.10.1, simply compiling it on CI would be great |
Hum, then maybe it would be worth creating template void pcl::features::computeApproximateCovariances<pcl::PointXYZ, pcl::PointXYZ>(const pcl::PointCloud<pcl::PointXYZ>&, const pcl::PointCloud<pcl::PointXYZ>&, std::vector<Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d>>&, double); It would take care of the instantiation and compilation without having to find valid use cases or how to call it correctly. Such a file would also be a good list of functions that lack tests - which can be added later. |
What about an cpp file with template instantiation instead of a test? |
Well, that's what I was proposing :p |
Oops. My bad again. I meant a cpp file "not in the test suite". There are such template instantiations in a lot of places in PCL |
Oh, Ill try to find an example of what you already have then. |
So basically I need to add Concerning the type of points: the function takes |
Yes. That's the right track. The cpp file will need 2 modes: core_points_only and all points.
The first template argument are points that have xyz, and the second are those that have normal. There are macros for both in PCL, which might help here. This will be the non-core-points mode. For core points mode, I know it's a handpicked selection, but I'm not sure which ones. @taketwo or @SergioRAgostinho might know better |
No big intuition, I would replicate what I've seen in other classes of the same module, related to this one. // Instantiations of specific point types
#ifdef PCL_ONLY_CORE_POINT_TYPES
PCL_INSTANTIATE_PRODUCT(PrincipalCurvaturesEstimation, ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA))((pcl::Normal))((pcl::PrincipalCurvatures)))
#else
PCL_INSTANTIATE_PRODUCT(PrincipalCurvaturesEstimation, (PCL_XYZ_POINT_TYPES)(PCL_NORMAL_POINT_TYPES)((pcl::PrincipalCurvatures)))
#endif In your case you're only interest the first two operands of the product. This seems to be the common instantiation in other classes of this module which need covariance information. |
computeApproximateCovariances
; fix compilation error for the same
A colleague told me that
computeApproximateCovariances
failed to compile: it seems that the automatic change from oldfor
loops to foreach loops introduced that bug.This this an obvious albeit untested fix since I don't have a test case. I guess that it could ship in 1.10.2 considering how simple and breaking it is.