File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -725,13 +725,17 @@ controller_interface::return_type ControllerManager::configure_controller(
725725 try
726726 {
727727 const auto avilable_state_interfaces = resource_manager_->available_state_interfaces ();
728- std::map<std::string, std::string> default_state_interfaces_remap;
729728 std::for_each (
730729 avilable_state_interfaces.begin (), avilable_state_interfaces.end (),
731- [&default_state_interfaces_remap](const auto & state_interface)
732- { default_state_interfaces_remap[state_interface] = state_interface; });
733- controller->get_node ()->declare_parameters (
734- " remap.state_interfaces" , default_state_interfaces_remap);
730+ [&controller](const auto & state_interface)
731+ {
732+ const auto ctrl_node = controller->get_node ();
733+ if (!ctrl_node->has_parameter (" remap.state_interfaces." + state_interface))
734+ {
735+ ctrl_node->declare_parameter (
736+ " remap.state_interfaces." + state_interface, state_interface);
737+ }
738+ });
735739 new_state = controller->configure ();
736740 if (new_state.id () != lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
737741 {
You can’t perform that action at this time.
0 commit comments