-
-
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
Made it so that PointCloudColorHandlerRGBField uses pcl::getFieldInde… #1295
Conversation
I think this is a reasonable change in default behavior. I have a couple of points though:
|
…us check for rgba field in PointCloudColorHandlerRGBField in response to comment by taketwo in pull request PointCloudLibrary#1295.
Hi Sergey, I addressed your comments in subsequent commit 0f5f3ff. Let me know if I can be of further help. John |
Looking at the |
addPointCloud (cloud,label) is instantiated by some examples
|
As promised, here is the error message for the build that includes the changes to pcl_visualizer.hpp but not point_cloud_color_handlers.hpp (Clang on MacOSX Yosemite):
Is there maybe a better way to address this error? My change seems to work and I can't think of any side effects that it could have. |
Sorry for the delay. Okay, the compile error actually makes sense. One other possible way to get over it is to use SFINAE to prevent instantiation of By the way, there is a meta-function specifically to check if there is Finally, can you squash the commits into one? Then I'll merge. |
…e RGB field if it is present in the custom point type without the definition of a custom color handler.
5dfb225
to
17c80c0
Compare
Sergey, I changed pcl::has_field<PointT,rgba/rgb> to pcl::has_color in addPointCloud, updated my fork, and incorporated all of my changes into a single commit. It should be ready to merge. Thanks for keeping the torch lit on a library that I personally get a lot of use out of, and have a good day. |
Thanks for contributing and for your kind words :) Have a nice day as well. |
Made it so that PointCloudColorHandlerRGBField uses pcl::getFieldInde…
…x, allowing PointCloudColorHandlerRGBField to be instantiated by clouds without RGB fields. In the absence of RGB fields, clouds are colored white. This was done to prevent a compilation error for the next change: made it so that PCLVisualizer::addPointCloud(cloud) uses a PointCloudColroHandlerRGBField by default if an RGB field is present in the custom point type. If an RGB field is not present, the previous behavior prevails. Previously, if addPointCloud(cloud) were called, a cryptic runtime error stating that the RGB field was not capable was given; these changes seem to implement a more intuitive behavior.
To reproduce the erroneous behavior in the previous versions of PCL, create a custom point type with fields identical to pcl::PointXYZRGBA and add try the following snippet:
The above code results in a compilation error.