Skip to content

Commit

Permalink
do not set parameters without value
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Dec 7, 2024
1 parent d15ba55 commit e43581a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CameraNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,10 @@ CameraNode::declareParameters()
RCLCPP_WARN_STREAM(get_logger(), s);

std::vector<rclcpp::Parameter> 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)
Expand Down

0 comments on commit e43581a

Please sign in to comment.