From e43581a77f081ef0322d77eae15f0953861daead Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 7 Dec 2024 23:23:15 +0100 Subject: [PATCH] do not set parameters without value --- src/CameraNode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CameraNode.cpp b/src/CameraNode.cpp index b80b2ed1..4a01e523 100644 --- a/src/CameraNode.cpp +++ b/src/CameraNode.cpp @@ -590,8 +590,10 @@ CameraNode::declareParameters() RCLCPP_WARN_STREAM(get_logger(), s); std::vector parameters_init_list; - for (const auto &[name, value] : parameters_init) - parameters_init_list.emplace_back(name, value); + for (const auto &[name, value] : parameters_init) { + if (value.get_type() != rclcpp::ParameterType::PARAMETER_NOT_SET) + parameters_init_list.emplace_back(name, value); + } const rcl_interfaces::msg::SetParametersResult param_set_result = set_parameters_atomically(parameters_init_list); if (!param_set_result.successful)