Skip to content

Commit

Permalink
check result of get_parameter(plugin_lib_names)
Browse files Browse the repository at this point in the history
Signed-off-by: Davide Faconti <[email protected]>
  • Loading branch information
facontidavide committed Feb 20, 2024
1 parent 216b0ba commit d0e6c33
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions nav2_bt_navigator/src/bt_navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/)
// Libraries to pull plugins (BT Nodes) from
std::vector<std::string> plugin_lib_names;
boost::split(plugin_lib_names, nav2::details::BT_BUILTIN_PLUGINS, boost::is_any_of(";"));
auto user_defined_plugins = get_parameter("plugin_lib_names").as_string_array();
// append user_defined_plugins to plugin_lib_names
plugin_lib_names.insert(
plugin_lib_names.end(), user_defined_plugins.begin(),
user_defined_plugins.end());

rclcpp::Parameter plugins_param;
if(get_parameter("plugin_lib_names", plugins_param) &&
plugins_param.get_type() == rclcpp::ParameterType::PARAMETER_STRING_ARRAY)
{
auto user_defined_plugins = plugins_param.as_string_array();
// append user_defined_plugins to plugin_lib_names
plugin_lib_names.insert(
plugin_lib_names.end(), user_defined_plugins.begin(),
user_defined_plugins.end());
}

nav2_core::FeedbackUtils feedback_utils;
feedback_utils.tf = tf_;
Expand Down

0 comments on commit d0e6c33

Please sign in to comment.