From c9fba522a013e3ca8823dff9d544368ad599d00d Mon Sep 17 00:00:00 2001 From: Walter Lucetti Date: Tue, 15 Feb 2022 12:27:07 +0100 Subject: [PATCH] Replace the deprecated function --- .../src/zed_camera/include/zed_camera_component.hpp | 2 ++ zed_components/src/zed_camera/src/zed_camera_component.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zed_components/src/zed_camera/include/zed_camera_component.hpp b/zed_components/src/zed_camera/include/zed_camera_component.hpp index 09cca25a..ab5b99c1 100644 --- a/zed_components/src/zed_camera/include/zed_camera_component.hpp +++ b/zed_components/src/zed_camera/include/zed_camera_component.hpp @@ -334,6 +334,8 @@ class ZedCamera : public rclcpp::Node // <---- Parameter variables // ----> Dynamic params + OnSetParametersCallbackHandle::SharedPtr mParamChangeCallbackHandle; + double mPubFrameRate = 15; double mImgDownsampleFactor = 1.0; int mCamBrightness = 4; diff --git a/zed_components/src/zed_camera/src/zed_camera_component.cpp b/zed_components/src/zed_camera/src/zed_camera_component.cpp index 369c068e..1ba2d532 100644 --- a/zed_components/src/zed_camera/src/zed_camera_component.cpp +++ b/zed_components/src/zed_camera/src/zed_camera_component.cpp @@ -260,8 +260,8 @@ void ZedCamera::initParameters() getOdParams(); // Dynamic parameters callback - set_on_parameters_set_callback( - std::bind(&ZedCamera::callback_paramChange, this, _1)); + //set_on_parameters_set_callback(std::bind(&ZedCamera::callback_paramChange, this, _1)); // deprecated + mParamChangeCallbackHandle = add_on_set_parameters_callback(std::bind(&ZedCamera::callback_paramChange, this, _1)); } void ZedCamera::getDebugParams() @@ -1252,6 +1252,8 @@ void ZedCamera::getOdParams() rcl_interfaces::msg::SetParametersResult ZedCamera::callback_paramChange(std::vector parameters) { + RCLCPP_INFO(get_logger(), "Parameter change callback"); + rcl_interfaces::msg::SetParametersResult result; result.successful = false;