00001 // g2o - General Graph Optimization 00002 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard 00003 // 00004 // g2o is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU Lesser General Public License as published 00006 // by the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // g2o is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #include "g2o/config.h" 00018 #include "vertex_se2.h" 00019 #include "vertex_point_xy.h" 00020 00021 #include "edge_se2_prior.h" 00022 #include "edge_se2.h" 00023 #include "edge_se2_multi.h" 00024 #include "edge_se2_pointxy.h" 00025 #include "edge_se2_pointxy_bearing.h" 00026 #include "edge_se2_pointxy_calib.h" 00027 00028 #include "g2o/core/factory.h" 00029 00030 #include "g2o/stuff/macros.h" 00031 00032 namespace g2o { 00033 00034 void G2O_ATTRIBUTE_CONSTRUCTOR init_types_slam2d(void) 00035 { 00036 Factory* factory = Factory::instance(); 00037 //cerr << "Calling " << __FILE__ << " " << __PRETTY_FUNCTION__ << endl; 00038 00039 factory->registerType("VERTEX_SE2", new HyperGraphElementCreator<VertexSE2>); 00040 factory->registerType("VERTEX_XY", new HyperGraphElementCreator<VertexPointXY>); 00041 00042 factory->registerType("EDGE_PIOR_SE2", new HyperGraphElementCreator<EdgeSE2Prior>); 00043 00044 factory->registerType("EDGE_SE2", new HyperGraphElementCreator<EdgeSE2>); 00045 factory->registerType("EDGE_SE2_XY", new HyperGraphElementCreator<EdgeSE2PointXY>); 00046 factory->registerType("EDGE_BEARING_SE2_XY", new HyperGraphElementCreator<EdgeSE2PointXYBearing>); 00047 factory->registerType("EDGE_SE2_MULTI", new HyperGraphElementCreator<EdgeSE2Multi>); 00048 00049 factory->registerType("EDGE_SE2_XY_CALIB", new HyperGraphElementCreator<EdgeSE2PointXYCalib>); 00050 00051 HyperGraphActionLibrary* actionLib = HyperGraphActionLibrary::instance(); 00052 00053 actionLib->registerAction(new VertexSE2WriteGnuplotAction); 00054 actionLib->registerAction(new VertexPointXYWriteGnuplotAction); 00055 actionLib->registerAction(new EdgeSE2WriteGnuplotAction); 00056 actionLib->registerAction(new EdgeSE2PointXYWriteGnuplotAction); 00057 actionLib->registerAction(new EdgeSE2PointXYBearingWriteGnuplotAction); 00058 00059 #ifdef G2O_HAVE_OPENGL 00060 actionLib->registerAction(new VertexSE2DrawAction); 00061 actionLib->registerAction(new VertexPointXYDrawAction); 00062 actionLib->registerAction(new EdgeSE2DrawAction); 00063 actionLib->registerAction(new EdgeSE2PointXYDrawAction); 00064 actionLib->registerAction(new EdgeSE2PointXYBearingDrawAction); 00065 #endif 00066 00067 } 00068 00069 } // end namespace