Skip to content

Commit

Permalink
Set success to false on parameter not found (#4704)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Gonçalves <[email protected]>
  • Loading branch information
PlatHum committed Oct 4, 2024
1 parent 1a3b637 commit e34634c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nav2_mppi_controller/src/parameters_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ParametersHandler::dynamicParamsCallback(
{
rcl_interfaces::msg::SetParametersResult result;
std::lock_guard<std::mutex> lock(parameters_change_mutex_);
bool success =true;

for (auto & pre_cb : pre_callbacks_) {
pre_cb();
Expand All @@ -67,14 +68,15 @@ ParametersHandler::dynamicParamsCallback(
callback->second(param);
} else {
RCLCPP_WARN(logger_, "Parameter %s not found", param_name.c_str());
success = false;
}
}

for (auto & post_cb : post_callbacks_) {
post_cb();
}

result.successful = true;
result.successful = success;
return result;
}

Expand Down

0 comments on commit e34634c

Please sign in to comment.