-
-
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 a family of "has field" meta-functions #462
Conversation
Are there any questions/reasons not to merge this? Sorry for my impatience, but I have a number of other pull requests that rely on this one. |
If it helps anything, a big +1 from my side on this one :) |
@andersgb1 Thanks for the support :) |
Add a family of "has field" meta-functions
Hi taketwo, I encountered a problem when I want to compile kinfu_app.cpp. As it includes point_types.h, then the compiler reported errors in namespace traits, it said 'type' is not a member of 'boost::mpl::contains'. As I'm a newer to PCL and boost, could you please give me some advice to solve this problem? I'm using MSVC2010 and boost 1.55. Thanks very much! |
I don't have MSVC at my disposal, so can not test. Though quick googling does not reveal any complaints about Boost MPL support in MSVC. You mentioned 'kinfu_app', but do you get the same error compiling the rest of PCL? |
Hi taketwo, Thanks for your reply! I build several other projects. Not only 'kinfu_app' get stuck by this error, some other projects such as "pcl_crf_segmentation", "pcl_icp" and "pcl_icp2d" also encounter this error, cause they all include 'point_types.h'. The error are the same ones as I described above. I also attach an image of the error. Hope you could help to solve this problem. Thanks! |
Hi @shawnshuailin, I use MSVS2010 on Win8 x64 machine with boost 1.50. |
@shawnshuailin Still, what about other (basic) parts of PCL like |
If Among the errors that you posted the 3rd one ("type is not a member of pcl::traits::fieldList") seems to be the "parent error" for the others. By the way, is the screenshot complete? Are there more errors that did not fit into? |
@taketwo I will try to build the solution again using boost 1.50 and then post the error list if they occur |
Yeah, I would also blame it on x32 MSVC. Speaking about |
As suggested in #440, this pull request adds a family of "has field" functions to check presence of a particular field in a point type both at compile- and run-time.
The functions are put inside
pcl::traits
namespace. Logically, they should belong to 'pcl_traits.h' file, however due to inclusion loop I had to move them to 'point_types.h'.The functions added are:
has_field
has_all_fields
has_any_field
for querying any kind/combination of fields, and:
has_xyz
has_normal
has_curvature
has_color
has_label
to check presence of most commonly used fields.
This pull request also adds a unit test for the new functions.