Go to the documentation of this file.
29 #include <boost/algorithm/string.hpp>
38 #include <boost_plugin_loader/plugin_loader.hpp>
39 #include <console_bridge/console.h>
57 plugin_loader_.search_paths.insert(TESSERACT_CONTACT_MANAGERS_PLUGIN_PATH);
59 TESSERACT_CONTACT_MANAGERS_PLUGINS,
60 boost::is_any_of(
":"),
61 boost::token_compress_on);
66 if (
const YAML::Node& plugin_info = config[ContactManagersPluginInfo::CONFIG_KEY])
69 plugin_loader_.search_paths.insert(cm_plugin_info.search_paths.begin(), cm_plugin_info.search_paths.end());
70 plugin_loader_.search_libraries.insert(cm_plugin_info.search_libraries.begin(),
71 cm_plugin_info.search_libraries.end());
141 throw std::runtime_error(
"ContactManagersPluginFactory, tried to remove discrete contact manager '" +
name +
142 "' that does not exist!");
154 throw std::runtime_error(
"ContactManagersPluginFactory, tried to set default discrete contact manager '" +
name +
155 "' that does not exist!");
163 throw std::runtime_error(
"ContactManagersPluginFactory, tried to get default discrete contact manager but none "
192 throw std::runtime_error(
"ContactManagersPluginFactory, tried to remove continuous contact manager '" +
name +
193 "' that does not exist!");
205 throw std::runtime_error(
"ContactManagersPluginFactory, tried to set default continuous contact manager '" +
name +
206 "' that does not exist!");
214 throw std::runtime_error(
"ContactManagersPluginFactory, tried to get default continuous contact manager but none "
223 std::unique_ptr<DiscreteContactManager>
229 CONSOLE_BRIDGE_logWarn(
"ContactManagersPluginFactory, tried to get discrete contact manager '%s' that does not "
238 std::unique_ptr<DiscreteContactManager>
246 return it->second->create(
name, plugin_info.
config);
249 if (plugin ==
nullptr)
251 CONSOLE_BRIDGE_logWarn(
"Failed to load symbol '%s'", plugin_info.
class_name.c_str());
255 return plugin->create(
name, plugin_info.
config);
258 catch (
const std::exception&)
260 CONSOLE_BRIDGE_logWarn(
"Failed to load symbol '%s'", plugin_info.
class_name.c_str());
266 std::unique_ptr<ContinuousContactManager>
272 CONSOLE_BRIDGE_logWarn(
"ContactManagersPluginFactory, tried to get continuous contact manager '%s' that does not "
281 std::unique_ptr<ContinuousContactManager>
289 return it->second->create(
name, plugin_info.
config);
292 if (plugin ==
nullptr)
294 CONSOLE_BRIDGE_logWarn(
"Failed to load symbol '%s'", plugin_info.
class_name.c_str());
298 return plugin->create(
name, plugin_info.
config);
301 catch (
const std::exception&)
303 CONSOLE_BRIDGE_logWarn(
"Failed to load symbol '%s'", plugin_info.
class_name.c_str());
312 std::ofstream fout(file_path.string());
325 config[ContactManagersPluginInfo::CONFIG_KEY] = cm_plugins;
YAML::Node processYamlIncludeDirective(const YAML::Node &node, const ResourceLocator &locator)
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
YAML::Node loadYamlString(const std::string &yaml_string, const ResourceLocator &locator)
std::string default_plugin
YAML::Node loadYamlFile(const std::string &file_path, const ResourceLocator &locator)
std::map< std::string, PluginInfo > PluginInfoMap