Skip to content

Commit

Permalink
Costmap plugins declare if not declared for reset capabilities (#1919)
Browse files Browse the repository at this point in the history
* fixing #1917 on declare if not declared

* fix API
  • Loading branch information
SteveMacenski committed Aug 11, 2020
1 parent 83a7bc5 commit 6674e03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nav2_costmap_2d/src/costmap_2d_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,16 @@ Costmap2DROS::getParameters()
get_parameter("width", map_width_meters_);
get_parameter("plugins", plugin_names_);

auto node = shared_from_this();

if (plugin_names_ == default_plugins_) {
for (size_t i = 0; i < default_plugins_.size(); ++i) {
declare_parameter(default_plugins_[i] + ".plugin", default_types_[i]);
nav2_util::declare_parameter_if_not_declared(
node, default_plugins_[i] + ".plugin", rclcpp::ParameterValue(default_types_[i]));
}
}
plugin_types_.resize(plugin_names_.size());

// Semantic checks...
auto node = shared_from_this();

// 1. All plugins must have 'plugin' param defined in their namespace to define the plugin type
for (size_t i = 0; i < plugin_names_.size(); ++i) {
plugin_types_[i] = nav2_util::get_plugin_type_param(node, plugin_names_[i]);
Expand Down

0 comments on commit 6674e03

Please sign in to comment.