From 785206ca292356a21d3b90d89cc0a62598cf687c Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Fri, 15 Apr 2022 23:06:40 +0200 Subject: [PATCH 1/2] Allow usage of std::string in searchAndGetParam() Removed also old TODO related to legacy ROS API --- .../nav_2d_utils/include/nav_2d_utils/parameters.hpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp b/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp index 5951bd09ef..8aa43d970a 100644 --- a/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp +++ b/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp @@ -64,15 +64,6 @@ param_t searchAndGetParam( const nav2_util::LifecycleNode::SharedPtr & nh, const std::string & param_name, const param_t & default_value) { - // TODO(crdelsey): Handle searchParam - // std::string resolved_name; - // if (nh->searchParam(param_name, resolved_name)) - // { - // param_t value = 0; - // nh->param(resolved_name, value, default_value); - // return value; - // } - param_t value = 0; nav2_util::declare_parameter_if_not_declared( nh, param_name, rclcpp::ParameterValue(default_value)); From 57c79ea3b88ccf69fbf92f780354949fb9a43549 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Fri, 15 Apr 2022 23:47:33 +0200 Subject: [PATCH 2/2] Fix --- .../nav_2d_utils/include/nav_2d_utils/parameters.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp b/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp index 8aa43d970a..c3c30428fe 100644 --- a/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp +++ b/nav2_dwb_controller/nav_2d_utils/include/nav_2d_utils/parameters.hpp @@ -64,6 +64,7 @@ param_t searchAndGetParam( const nav2_util::LifecycleNode::SharedPtr & nh, const std::string & param_name, const param_t & default_value) { + param_t value; nav2_util::declare_parameter_if_not_declared( nh, param_name, rclcpp::ParameterValue(default_value));