From 907014cd571ed9ac974c88bf1c481280a1126300 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Wed, 3 Jul 2024 21:32:40 +0200 Subject: [PATCH] Disable pruning by default --- core/CMakeLists.txt | 4 ++++ core/src/container.cpp | 6 ++++++ core/test/CMakeLists.txt | 2 ++ 3 files changed, 12 insertions(+) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 12af7292b..9d3b4d991 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -18,6 +18,7 @@ find_package(catkin REQUIRED COMPONENTS ) option(MOVEIT_CI_WARNINGS "Enable all warnings used by CI" OFF) # We use our own set of warnings +option(ENABLE_PRUNING "Enable pruning on failed solutions" OFF) moveit_build_options() catkin_python_setup() @@ -39,6 +40,9 @@ catkin_package( ) add_compile_options(-fvisibility-inlines-hidden) +if(ENABLE_PRUNING) + add_compile_definitions(ENABLE_PRUNING) +endif() set(PROJECT_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/include/moveit/task_constructor) diff --git a/core/src/container.cpp b/core/src/container.cpp index b4840d491..82cf907bf 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -232,6 +232,7 @@ inline void updateStatePrios(const InterfaceState& s, const InterfaceState::Prio } void ContainerBasePrivate::onNewFailure(const Stage& child, const InterfaceState* from, const InterfaceState* to) { +#ifdef ENABLE_PRUNING ROS_DEBUG_STREAM_NAMED("Pruning", fmt::format("'{}' generated a failure", child.name())); switch (child.pimpl()->interfaceFlags()) { case GENERATE: @@ -251,6 +252,11 @@ void ContainerBasePrivate::onNewFailure(const Stage& child, const InterfaceState setStatus(&child, from, to, InterfaceState::Status::ARMED); break; } +#else + (void)child; + (void)from; + (void)to; +#endif // printChildrenInterfaces(*this, false, child); } diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index 09e6d477b..492d84a58 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -38,7 +38,9 @@ if (CATKIN_ENABLE_TESTING) mtc_add_gtest(test_stage.cpp) mtc_add_gtest(test_container.cpp) mtc_add_gmock(test_serial.cpp) +if(ENABLE_PRUNING) mtc_add_gmock(test_pruning.cpp) +endif() mtc_add_gtest(test_properties.cpp) mtc_add_gtest(test_cost_terms.cpp)