Skip to content

Commit

Permalink
set parameters atomically
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Nov 19, 2024
1 parent ebaba84 commit 8774469
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/CameraNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ CameraNode::declareParameters()
std::vector<rclcpp::Parameter> parameters_init_list;
for (const auto &[name, value] : parameters_init)
parameters_init_list.emplace_back(name, value);
set_parameters(parameters_init_list);
const rcl_interfaces::msg::SetParametersResult param_set_result =
set_parameters_atomically(parameters_init_list);
if (!param_set_result.successful)
RCLCPP_ERROR_STREAM(get_logger(), "Cannot declare parameters with default value: " << param_set_result.reason);
}

void
Expand Down

0 comments on commit 8774469

Please sign in to comment.