diff --git a/nav2_bt_navigator/src/bt_navigator.cpp b/nav2_bt_navigator/src/bt_navigator.cpp index 2b2c116eeb..7ff78ac096 100644 --- a/nav2_bt_navigator/src/bt_navigator.cpp +++ b/nav2_bt_navigator/src/bt_navigator.cpp @@ -75,11 +75,17 @@ BtNavigator::on_configure(const rclcpp_lifecycle::State & /*state*/) // Libraries to pull plugins (BT Nodes) from std::vector 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_;