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 @@ -692,13 +692,17 @@ controller_interface::return_type ControllerManager::configure_controller(
692692 try
693693 {
694694 const auto avilable_state_interfaces = resource_manager_->available_state_interfaces ();
695- std::map<std::string, std::string> default_state_interfaces_remap;
696695 std::for_each (
697696 avilable_state_interfaces.begin (), avilable_state_interfaces.end (),
698- [&default_state_interfaces_remap](const auto & state_interface)
699- { default_state_interfaces_remap[state_interface] = state_interface; });
700- controller->get_node ()->declare_parameters (
701- " remap.state_interfaces" , default_state_interfaces_remap);
697+ [&controller](const auto & state_interface)
698+ {
699+ const auto ctrl_node = controller->get_node ();
700+ if (!ctrl_node->has_parameter (" remap.state_interfaces." + state_interface))
701+ {
702+ ctrl_node->declare_parameter (
703+ " remap.state_interfaces." + state_interface, state_interface);
704+ }
705+ });
702706 new_state = controller->configure ();
703707 if (new_state.id () != lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
704708 {
You can’t perform that action at this time.
0 commit comments