00001 // Copyright (c) 2009-2010 Rosen Diankov 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); 00004 // you may not use this file except in compliance with the License. 00005 // You may obtain a copy of the License at 00006 // http://www.apache.org/licenses/LICENSE-2.0 00007 // 00008 // Unless required by applicable law or agreed to in writing, software 00009 // distributed under the License is distributed on an "AS IS" BASIS, 00010 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00011 // See the License for the specific language governing permissions and 00012 // limitations under the License. 00013 // 00014 // \author Rosen Diankov 00015 #include "plugindefs.h" 00016 00017 #include "roslaser2d.h" 00018 #include "rossensorpublisher.h" 00019 00020 #include <rave/plugin.h> 00021 00022 static list< boost::shared_ptr<void> >* s_listRegisteredReaders=NULL; 00023 InterfaceBasePtr CreateInterfaceValidated(InterfaceType type, const std::string& interfacename, std::istream& sinput, EnvironmentBasePtr penv) 00024 { 00025 if( !s_listRegisteredReaders ) { 00026 s_listRegisteredReaders = new list< boost::shared_ptr<void> >(); 00027 s_listRegisteredReaders->push_back(RaveRegisterXMLReader(PT_Sensor,"roslaser2d",ROSLaser2D::CreateXMLReader)); 00028 } 00029 switch(type) { 00030 case PT_Sensor: 00031 if( interfacename == "roslaser2d") 00032 return InterfaceBasePtr(new ROSLaser2D(penv)); 00033 break; 00034 case PT_ProblemInstance: 00035 if( interfacename == "rossensorpublisher" ) 00036 return InterfaceBasePtr(new ROSSensorPublisher(penv)); 00037 break; 00038 default: 00039 break; 00040 } 00041 return InterfaceBasePtr(); 00042 } 00043 00044 void GetPluginAttributesValidated(PLUGININFO& info) 00045 { 00046 info.interfacenames[PT_Sensor].push_back("ROSLaser2D"); 00047 info.interfacenames[PT_ProblemInstance].push_back("ROSSensorPublisher"); 00048 } 00049 00050 void DestroyPlugin() 00051 { 00052 delete s_listRegisteredReaders; 00053 s_listRegisteredReaders = NULL; 00054 }