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 @@ -768,13 +768,17 @@ controller_interface::return_type ControllerManager::configure_controller(
768768 try
769769 {
770770 const auto avilable_state_interfaces = resource_manager_->available_state_interfaces ();
771- std::map<std::string, std::string> default_state_interfaces_remap;
772771 std::for_each (
773772 avilable_state_interfaces.begin (), avilable_state_interfaces.end (),
774- [&default_state_interfaces_remap](const auto & state_interface)
775- { default_state_interfaces_remap[state_interface] = state_interface; });
776- controller->get_node ()->declare_parameters (
777- " remap.state_interfaces" , default_state_interfaces_remap);
773+ [&controller](const auto & state_interface)
774+ {
775+ const auto ctrl_node = controller->get_node ();
776+ if (!ctrl_node->has_parameter (" remap.state_interfaces." + state_interface))
777+ {
778+ ctrl_node->declare_parameter (
779+ " remap.state_interfaces." + state_interface, state_interface);
780+ }
781+ });
778782 new_state = controller->configure ();
779783 if (new_state.id () != lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
780784 {
You can’t perform that action at this time.
0 commit comments