Skip to content

Commit

Permalink
Disable param callback code on humble
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbinney committed Sep 4, 2024
1 parent 27bf41c commit ed29567
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if(${rclcpp_VERSION_MAJOR} GREATER_EQUAL 20)
add_compile_definitions(RCLCPP_SUPPORTS_MATCHED_CALLBACKS)
endif()

if(${rclcpp_VERSION_MAJOR} GREATER_EQUAL 17)
add_compile_definitions(RCLCPP_SUPPORTS_POST_SET_PARAMS_CALLBACK)
endif()

ament_auto_add_library(laser_scan_filters SHARED src/laser_scan_filters.cpp)
ament_auto_add_library(laser_filter_chains SHARED
src/scan_to_cloud_filter_chain.cpp
Expand Down
5 changes: 5 additions & 0 deletions include/laser_filters/speckle_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ class LaserScanSpeckleFilter : public filters::FilterBase<sensor_msgs::msg::Lase
break;
}

#ifdef RCLCPP_SUPPORTS_POST_SET_PARAMS_CALLBACK
post_set_parameters_callback_handle_ = params_interface_->add_post_set_parameters_callback(
std::bind(&LaserScanSpeckleFilter::reconfigureCB, this, std::placeholders::_1));
#endif

return true;
}
Expand Down Expand Up @@ -300,7 +302,10 @@ class LaserScanSpeckleFilter : public filters::FilterBase<sensor_msgs::msg::Lase
double max_range = 0;
double max_range_difference = 0;
int filter_window = 0;

#ifdef RCLCPP_SUPPORTS_POST_SET_PARAMS_CALLBACK
rclcpp::node_interfaces::PostSetParametersCallbackHandle::SharedPtr post_set_parameters_callback_handle_;
#endif // RCLCPP_SUPPORTS_POST_SET_PARAMS_CALLBACK
};
}
#endif /* speckle_filter.h */

0 comments on commit ed29567

Please sign in to comment.