From 1887ba26ff71db41655691e5ad4d83c7baaed3b9 Mon Sep 17 00:00:00 2001 From: Markus Vieth <39675748+mvieth@users.noreply.github.com> Date: Tue, 14 Jul 2020 19:58:17 +0200 Subject: [PATCH] Add workaround for deprecated filter functions (#285) * Add workaround for deprecated filter functions See also: https://github.com/PointCloudLibrary/pcl/commit/f26c6fcc24386c29213b62423710c8927cbe1d21 https://github.com/PointCloudLibrary/pcl/commit/630627b2accad395f80bc6518f8dcd94a1f9ad31 * Silence cmake warning regarding deprecated FindEigen PCL searches for a FindEigen.cmake file. The FindEigen.cmake file delivered with PCL actually finds Eigen3, but there is a FindEigen.cmake in cmake_modules that is deprecated and generates a cmake warning. With the old order of the find_packages, there seems to be a mix-up and PCL finds the deprecated file. The new order solves that problem. --- pcl_ros/CMakeLists.txt | 2 +- pcl_ros/src/pcl_ros/filters/passthrough.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pcl_ros/CMakeLists.txt b/pcl_ros/CMakeLists.txt index 9a5b764b..3065f20b 100644 --- a/pcl_ros/CMakeLists.txt +++ b/pcl_ros/CMakeLists.txt @@ -4,10 +4,10 @@ project(pcl_ros) add_compile_options(-std=c++14) ## Find system dependencies +find_package(PCL REQUIRED COMPONENTS core features filters io segmentation surface) find_package(cmake_modules REQUIRED) find_package(Boost REQUIRED COMPONENTS system filesystem thread) find_package(Eigen3 REQUIRED) -find_package(PCL REQUIRED COMPONENTS core features filters io segmentation surface) if(NOT "${PCL_LIBRARIES}" STREQUAL "") # For debian: https://github.com/ros-perception/perception_pcl/issues/139 diff --git a/pcl_ros/src/pcl_ros/filters/passthrough.cpp b/pcl_ros/src/pcl_ros/filters/passthrough.cpp index cb4b5273..110fbac5 100644 --- a/pcl_ros/src/pcl_ros/filters/passthrough.cpp +++ b/pcl_ros/src/pcl_ros/filters/passthrough.cpp @@ -95,11 +95,19 @@ pcl_ros::PassThrough::config_callback (pcl_ros::FilterConfig &config, uint32_t / } // Check the current value for the negative flag +#if PCL_VERSION_COMPARE(<, 1, 10, 0) if (impl_.getFilterLimitsNegative () != config.filter_limit_negative) +#else + if (impl_.getNegative () != config.filter_limit_negative) +#endif { NODELET_DEBUG ("[%s::config_callback] Setting the filter negative flag to: %s.", getName ().c_str (), config.filter_limit_negative ? "true" : "false"); // Call the virtual method in the child +#if PCL_VERSION_COMPARE(<, 1, 10, 0) impl_.setFilterLimitsNegative (config.filter_limit_negative); +#else + impl_.setNegative (config.filter_limit_negative); +#endif } // The following parameters are updated automatically for all PCL_ROS Nodelet Filters as they are inexistent in PCL