From 851434a59ef2de7bccb1a46e27882c0480534289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Thu, 5 Oct 2023 10:07:10 +0200 Subject: [PATCH] Fixed param name (#36) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .../point_cloud_transport/simple_publisher_plugin.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/point_cloud_transport/include/point_cloud_transport/simple_publisher_plugin.hpp b/point_cloud_transport/include/point_cloud_transport/simple_publisher_plugin.hpp index 354c9d5..5e80e05 100644 --- a/point_cloud_transport/include/point_cloud_transport/simple_publisher_plugin.hpp +++ b/point_cloud_transport/include/point_cloud_transport/simple_publisher_plugin.hpp @@ -106,8 +106,15 @@ class SimplePublisherPlugin : public point_cloud_transport::PublisherPlugin rcl_interfaces::msg::ParameterDescriptor()) { if (simple_impl_) { + // Declare Parameters + uint ns_len = simple_impl_->node_->get_effective_namespace().length(); + std::string param_base_name = getTopic().substr(ns_len); + std::replace(param_base_name.begin(), param_base_name.end(), '/', '.'); + + std::string param_name = param_base_name + "." + parameter_name; + simple_impl_->node_->template declare_parameter( - parameter_name, value, parameter_descriptor); + param_name, value, parameter_descriptor); return true; } return false;