Skip to content

Commit

Permalink
Add workaround for deprecated filter functions (#285)
Browse files Browse the repository at this point in the history
* Add workaround for deprecated filter functions
See also:
PointCloudLibrary/pcl@f26c6fc
PointCloudLibrary/pcl@630627b

* 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.
  • Loading branch information
mvieth authored Jul 14, 2020
1 parent e812d3c commit 1887ba2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pcl_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions pcl_ros/src/pcl_ros/filters/passthrough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1887ba2

Please sign in to comment.