116 std::map<std::string, std::list<ControllerInfo>> resource_map;
120 for (
const auto& controller_info : info)
122 for (
const auto& claimed_resource : controller_info.claimed_resources)
124 for (
const auto& iface_resource : claimed_resource.resources)
126 resource_map[iface_resource].push_back(controller_info);
132 bool in_conflict =
false;
133 for (
const auto& resource_name_and_claiming_controllers : resource_map)
135 if (resource_name_and_claiming_controllers.second.size() > 1)
137 std::string controller_list;
138 for (
const auto& controller : resource_name_and_claiming_controllers.second)
139 controller_list += controller.name +
", ";
140 ROS_WARN(
"Resource conflict on [%s]. Controllers = [%s]", resource_name_and_claiming_controllers.first.c_str(), controller_list.c_str());
158 const std::list<ControllerInfo>& ) {
return true; }
164 virtual void doSwitch(
const std::list<ControllerInfo>& ,
165 const std::list<ControllerInfo>& ) {}