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

Add property to enable/disable pruning at runtime #590

Merged
merged 2 commits into from
Jul 6, 2024

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented Jul 5, 2024

Rebase and cleanup of #358. Closes #358.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.63%. Comparing base (907014c) to head (e9188d8).

Files Patch % Lines
core/test/test_pruning.cpp 60.00% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
+ Coverage   57.23%   57.63%   +0.40%     
==========================================
  Files         130      131       +1     
  Lines       10434    10621     +187     
  Branches      956      954       -2     
==========================================
+ Hits         5971     6120     +149     
- Misses       4416     4454      +38     
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this, I like the idea of having a simple property based API around this.I am not fully understanding the macros around this, is it necessary to have a macro-based API around this?

if(ENABLE_PRUNING)
add_compile_definitions(ENABLE_PRUNING)
endif()
add_compile_definitions(ENABLE_PRUNING=$<BOOL:${ENABLE_PRUNING}>)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is that doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is exposing the cmake option as a compiler definition to serve as the default of setPruning() below.

@@ -92,6 +92,7 @@ const ContainerBase* TaskPrivate::stages() const {

Task::Task(const std::string& ns, bool introspection, ContainerBase::pointer&& container)
: WrapperBase(new TaskPrivate(this, ns), std::move(container)) {
setPruning(ENABLE_PRUNING);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be possible to just have a C++ API with defaulting to true without exposing this via CMake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I introduced the cmake option before and would like to keep it to define the default.

@rhaschke rhaschke enabled auto-merge (squash) July 5, 2024 15:55
@rhaschke rhaschke disabled auto-merge July 6, 2024 14:49
@rhaschke rhaschke merged commit fbc05e4 into moveit:master Jul 6, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

3 participants