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

Refactor MaskMap and deprecate several of its methods #3399

Merged
merged 3 commits into from
Oct 15, 2019
Merged

Refactor MaskMap and deprecate several of its methods #3399

merged 3 commits into from
Oct 15, 2019

Conversation

lightyear15
Copy link
Contributor

@lightyear15 lightyear15 commented Oct 4, 2019

Quick refactor to mask_map to make it more into C++14

  • "default" to mark default constructor and destructor
  • default values for member variables instead of default constructor
  • avoid output parameters passed by reference, RVO will make the job for
    us

This PR deprecates void getDifferenceMask(const MaskMap&, const MaskMap&, MaskMap&) in favor of a new overload with return value instead of output parameter.

@lightyear15
Copy link
Contributor Author

Just a small pr to introduce myself.
I saw you have an ongoing project of modernizing the codebase and ( if I'm not mistaken) get read of boost dependencies and replace it with std wherever possible.
I would love to give an hand on this.

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Sorry for the delay. Real life gets in the way for the maintainers sometimes :)

I've just taken a quick look Thanks for the contribution in advance

recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, welcome to PCL, and thanks for contributing!

recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
@@ -65,10 +65,16 @@ namespace pcl
inline const unsigned char*
getData () const { return (&data_[0]); }

[[deprecated("output parameter is not desirable,\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[[deprecated("output parameter is not desirable,\
[[deprecated("use getDifferenceMask() with return value instead")]]

For deprecation messages, we generally try to stick to "use %signature% instead" template. The %signature% part does not have to be a formal signature but should be sufficient to understand which function/overload is meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cheers

recognition/include/pcl/recognition/mask_map.h Outdated Show resolved Hide resolved
Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the noise. Time and again, I press "approve" instead of "comment"/"request changes" when finishing a review, grrr.

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set of comments is just nitpicks. Not required. LGTM

recognition/include/pcl/recognition/mask_map.h Outdated Show resolved Hide resolved
recognition/include/pcl/recognition/mask_map.h Outdated Show resolved Hide resolved
recognition/src/mask_map.cpp Outdated Show resolved Hide resolved
Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor improvement for the PCL_NODISCARD macro please

common/include/pcl/pcl_macros.h Outdated Show resolved Hide resolved
recognition/include/pcl/recognition/mask_map.h Outdated Show resolved Hide resolved
recognition/include/pcl/recognition/mask_map.h Outdated Show resolved Hide resolved
@kunaltyagi
Copy link
Member

🚀 if CI is a go

@lightyear15
Copy link
Contributor Author

Build.Ubuntu fails because of "no space left on the device"
Anyone knows what is going on?
As a side note regarding compilation: sometimes, compiling some CU takes up more than 4 GB of ram, which is definitely too much for my poor old laptop. Is there any intent to fix or mitigate this issue? Is it considered an issue at all?

Copy link
Member

@kunaltyagi kunaltyagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any intent to fix or mitigate this issue? Is it considered an issue at all?

Yes, this is an issue, which will get easier to debug after clang-9 is released. Feel free to address this since we have limited time and manpower.

Anyone knows what is going on?

That'd my fault. I added a cache to speed up compilations which succeeded, but now we are exceeding the memory limits. I'm hesitant to fiddle with cache size. Maybe reducing cache size to 7 GB or even smaller might work, but it might affect compilation times (which fell 45%). Meanwhile, @taketwo has created an issue with Azure to possibly give extra disk space for open source projects since it affects WIndows (without cache) too. See #3387 for details

lightyear15 and others added 3 commits October 14, 2019 18:06
For c++17 in converts to [[nodiscard]] othwerwise, just empty macro
Quick refactor to mask_map to make it more into C++14
- "default" to mark default constructor and destructor
- default values for member variables instead of default constructor
- avoid output parameters passed by reference, RVO will make the job for
us
Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased on current master and added a commit that removes usage of deprecated signature within PCL.

@taketwo taketwo added changelog: deprecation Meta-information for changelog generation module: recognition labels Oct 14, 2019
@kunaltyagi
Copy link
Member

@lightyear15 I've created #3414 so you can find the offending compilation units. There are some low lying fruits like per-initializing some templates which might interest you

@taketwo taketwo changed the title rejuvinating mask_map Rejuvinate MaskMap Oct 15, 2019
@taketwo taketwo merged commit 86d6894 into PointCloudLibrary:master Oct 15, 2019
@lightyear15 lightyear15 deleted the mask_map branch October 15, 2019 08:36
@taketwo taketwo changed the title Rejuvinate MaskMap Refactor MaskMap and deprecate several of its methods Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: deprecation Meta-information for changelog generation module: recognition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants