コード例 #1
0
bool createHelper(string class_type, Classifier* &c)
{
    try{
        c = c_loader.createClassInstance(class_type);
    }
    catch(pluginlib::PluginlibException& ex){
        ROS_ERROR("Classifer plugin failed to load! Error: %s", ex.what());
    }
    
    return true;
}
コード例 #2
0
RefineAlgorithm* RefineAlgorithm::RefineAlgFactory(XMLTag* tag)
{
	std::string name = tag->GetName();
	RefineAlgorithm*  alg = NULL;
  try
  {
    alg = s_ref_alg_loader.createClassInstance(name);
    alg->SetData(tag);
  }
  catch(pluginlib::PluginlibException& ex)
  {
  //handle the class failing to load
    printf("RefineAlgorithm: The plugin failed to load for some reason. Error: %s\n", ex.what());
    printf("RefineAlgorithm: Tag failed: %s\n", tag->GetName().c_str());
  }
	return alg;
}